Skip to content

Commit 667b702

Browse files
authored
add setDebugfunction & setDebugdata functions (#20)
1 parent 3a590c7 commit 667b702

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Easy.zig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,17 @@ pub fn setWritefunction(
365365
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_WRITEFUNCTION, func));
366366
}
367367

368+
pub fn setDebugdata(self: Self, data: *const anyopaque) !void {
369+
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_DEBUGDATA, data));
370+
}
371+
372+
pub fn setDebugfunction(
373+
self: Self,
374+
func: *const fn (*c.CURL, c.curl_infotype, [*]c_char, c_uint, *anyopaque) callconv(.C) c_int,
375+
) !void {
376+
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_DEBUGFUNCTION, func));
377+
}
378+
368379
pub fn setUsername(self: Self, username: [:0]const u8) !void {
369380
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_USERNAME, username.ptr));
370381
}

0 commit comments

Comments
 (0)