summaryrefslogtreecommitdiff
path: root/libarchive.zig
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive.zig')
-rw-r--r--libarchive.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/libarchive.zig b/libarchive.zig
index dab205e..ff45344 100644
--- a/libarchive.zig
+++ b/libarchive.zig
@@ -94,6 +94,13 @@ pub const Read = struct {
94 } 94 }
95 } 95 }
96 96
97 pub fn openMemory(self: *Read, buffer: []const u8) !void {
98 if (c.archive_read_open_memory(self.raw, buffer.ptr, buffer.len) != c.ARCHIVE_OK) {
99 std.log.err("archive_read_open_memory: {s}", .{c.archive_error_string(self.raw)});
100 return error.LibArchiveError;
101 }
102 }
103
97 pub fn nextHeader(self: *Read) !?Entry { 104 pub fn nextHeader(self: *Read) !?Entry {
98 var header_raw: ?*c.archive_entry = undefined; 105 var header_raw: ?*c.archive_entry = undefined;
99 var r = c.ARCHIVE_RETRY; 106 var r = c.ARCHIVE_RETRY;