ffi-libarchive 1.1.3 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ffi-libarchive/archive.rb +28 -2
- data/lib/ffi-libarchive/reader.rb +15 -0
- data/lib/ffi-libarchive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7094a13cfebde03bfffdb80ebafdddd86995535898ca553808d06626dac1290
|
4
|
+
data.tar.gz: ce502afcd053c2af3680ce85c8d6fe866f64fad788a5e354c193520f12c936d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40adfc4eef27b5a0712ec75dd4861fff389d7ec70c28372059b56b0b7f4142fc1c64bca5164ef07ff13b1eec8b90aa153bc1523f7d178da570a38f8119e0a315
|
7
|
+
data.tar.gz: 8eadb8844908a5e2fe48b571252ee4413476068188eefb896901cc140177acb01bd541ad7971922e88425240926c22e96eb7d5899d84581cfb274336a6c2173f
|
@@ -12,11 +12,17 @@ module Archive
|
|
12
12
|
|
13
13
|
attach_function :archive_version_number, [], :int
|
14
14
|
attach_function :archive_version_string, [], :string
|
15
|
-
|
15
|
+
|
16
|
+
attach_function :archive_compression, [:pointer], :int
|
17
|
+
attach_function :archive_compression_name, [:pointer], :string
|
16
18
|
attach_function :archive_errno, [:pointer], :int
|
19
|
+
attach_function :archive_error_string, [:pointer], :string
|
20
|
+
attach_function :archive_format, [:pointer], :int
|
21
|
+
attach_function :archive_format_name, [:pointer], :string
|
17
22
|
|
18
23
|
attach_function :archive_read_new, [], :pointer
|
19
24
|
attach_function :archive_read_open_filename, %i{pointer string size_t}, :int
|
25
|
+
attach_function :archive_read_open_fd, %i{pointer int size_t}, :int
|
20
26
|
attach_function :archive_read_open_memory, %i{pointer pointer size_t}, :int
|
21
27
|
attach_function :archive_read_open1, [:pointer], :int
|
22
28
|
attach_function :archive_read_support_compression_program, %i{pointer string}, :int
|
@@ -76,7 +82,7 @@ module Archive
|
|
76
82
|
attach_function :archive_read_extract, %i{pointer pointer int}, :int
|
77
83
|
attach_function :archive_read_header_position, [:pointer], :int
|
78
84
|
attach_function :archive_read_next_header, %i{pointer pointer}, :int
|
79
|
-
attach_function :archive_read_data, %i{pointer pointer size_t}, :
|
85
|
+
attach_function :archive_read_data, %i{pointer pointer size_t}, :ssize_t
|
80
86
|
attach_function :archive_read_data_into_fd, %i{pointer int}, :int
|
81
87
|
|
82
88
|
attach_function :archive_write_new, [], :pointer
|
@@ -284,6 +290,10 @@ module Archive
|
|
284
290
|
Reader.open_filename file_name, command, &block
|
285
291
|
end
|
286
292
|
|
293
|
+
def self.read_open_fd(fd, command = nil, &block)
|
294
|
+
Reader.open_fd fd, command, &block
|
295
|
+
end
|
296
|
+
|
287
297
|
def self.read_open_memory(string, command = nil, &block)
|
288
298
|
Reader.open_memory string, command, &block
|
289
299
|
end
|
@@ -355,6 +365,14 @@ module Archive
|
|
355
365
|
end
|
356
366
|
protected :archive
|
357
367
|
|
368
|
+
def compression
|
369
|
+
C.archive_compression(@archive)
|
370
|
+
end
|
371
|
+
|
372
|
+
def compression_name
|
373
|
+
C.archive_compression_name(@archive)
|
374
|
+
end
|
375
|
+
|
358
376
|
def error_string
|
359
377
|
C.archive_error_string(@archive)
|
360
378
|
end
|
@@ -362,5 +380,13 @@ module Archive
|
|
362
380
|
def errno
|
363
381
|
C.archive_errno(@archive)
|
364
382
|
end
|
383
|
+
|
384
|
+
def format
|
385
|
+
C.archive_format(@archive)
|
386
|
+
end
|
387
|
+
|
388
|
+
def format_name
|
389
|
+
C.archive_format_name(@archive)
|
390
|
+
end
|
365
391
|
end
|
366
392
|
end
|
@@ -15,6 +15,19 @@ module Archive
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
+
def self.open_fd(fd, command = nil, strip_components: 0)
|
19
|
+
if block_given?
|
20
|
+
reader = open_fd fd, command, strip_components: strip_components
|
21
|
+
begin
|
22
|
+
yield reader
|
23
|
+
ensure
|
24
|
+
reader.close
|
25
|
+
end
|
26
|
+
else
|
27
|
+
new fd: fd, command: command, strip_components: strip_components
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
18
31
|
def self.open_memory(string, command = nil)
|
19
32
|
if block_given?
|
20
33
|
reader = open_memory string, command
|
@@ -66,6 +79,8 @@ module Archive
|
|
66
79
|
case
|
67
80
|
when params[:file_name]
|
68
81
|
raise Error, @archive if C.archive_read_open_filename(archive, params[:file_name], 1024) != C::OK
|
82
|
+
when params[:fd]
|
83
|
+
raise Error, @archive if C.archive_read_open_fd(archive, params[:fd], 1024) != C::OK
|
69
84
|
when params[:memory]
|
70
85
|
str = params[:memory]
|
71
86
|
@data = FFI::MemoryPointer.new(str.bytesize + 1)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-libarchive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bellone
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-01-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ffi
|