Module: Archive::C

Extended by:
FFI::Library
Defined in:
lib/ffi-libarchive/archive.rb

Constant Summary collapse

EOF =
1
OK =
0
RETRY =
-10
WARN =
-20
FAILED =
-25
FATAL =
-30
DATA_BUFFER_SIZE =
2**16

Class Method Summary collapse

Class Method Details

.archive_write_set_compression(archive, compression) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/ffi-libarchive/archive.rb', line 97

def self.archive_write_set_compression(archive, compression)
  case compression
  when String
    archive_write_set_compression_program archive, compression
  when COMPRESSION_BZIP2
    archive_write_set_compression_bzip2 archive
  when COMPRESSION_GZIP
    archive_write_set_compression_gzip 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
end

.attach_function_maybe(*args) ⇒ Object



5
6
7
8
# File 'lib/ffi-libarchive/archive.rb', line 5

def self.attach_function_maybe(*args)
  attach_function(*args)
rescue FFI::NotFoundError # rubocop:disable Lint/HandleExceptions
end