module Archive::C

Constants

DATA_BUFFER_SIZE

endregion

EOF

region Error Codes

FAILED
FATAL
OK
RETRY
WARN

Public Class Methods

archive_write_set_compression(archive, compression) click to toggle source

@param [FFI::Pointer] archive @return [Integer]

# File lib/ffi_libarchive/api.rb, line 125
def self.archive_write_set_compression(archive, compression)
  return archive_write_set_compression_program(archive, compression) if compression.is_a?(String)
  return archive_write_add_filter(archive, compression) if respond_to?(:archive_write_add_filter)

  # :nocov:
  case compression
  when COMPRESSION_BZIP2
    archive_write_set_compression_bzip2 archive
  when COMPRESSION_GZIP
    archive_write_set_compression_gzip archive
  when COMPRESSION_LZIP
    archive_write_set_compression_lzip archive
  when COMPRESSION_LZMA
    archive_write_set_compression_lzma archive
  when COMPRESSION_XZ
    archive_write_set_compression_xz archive
  when COMPRESSION_COMPRESS
    archive_write_set_compression_compress archive
  when COMPRESSION_NONE
    archive_write_set_compression_none archive
  else
    raise "Unknown compression type: #{compression}"
  end
  # :nocov:
end
attach_function_maybe(*args) click to toggle source
# File lib/ffi_libarchive/api.rb, line 7
def self.attach_function_maybe(*args)
  attach_function(*args)
rescue FFI::NotFoundError # rubocop:disable all
end