Skip to content

Commit

Permalink
add setDebugfunction & setDebugdata functions (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiawl authored Oct 25, 2024
1 parent 3a590c7 commit 667b702
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Easy.zig
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,17 @@ pub fn setWritefunction(
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_WRITEFUNCTION, func));
}

pub fn setDebugdata(self: Self, data: *const anyopaque) !void {
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_DEBUGDATA, data));
}

pub fn setDebugfunction(
self: Self,
func: *const fn (*c.CURL, c.curl_infotype, [*]c_char, c_uint, *anyopaque) callconv(.C) c_int,
) !void {
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_DEBUGFUNCTION, func));
}

pub fn setUsername(self: Self, username: [:0]const u8) !void {
try checkCode(c.curl_easy_setopt(self.handle, c.CURLOPT_USERNAME, username.ptr));
}
Expand Down

0 comments on commit 667b702

Please sign in to comment.