Open ringus1 opened 1 month ago
To expose the curl_off_t
type, we need to include typedef
s from curl/system.h
in ffi.cdef()
.
curl_off_t looks like a long
curl.getinfo(curl_cffi.CurlInfo.SIZE_DOWNLOAD_T)
ret_option = {
0x100000: "char**",
0x200000: "long*",
0x300000: "double*",
0x400000: "struct curl_slist **",
0x500000: "long*",
0x600000: "long*"
}
ret_cast_option = {
0x100000: ffi.string,
0x200000: int,
0x300000: float,
0x500000: int,
0x600000: int,
}
I tried to add the typedef
to cdef
, but it does not work as documented, perhaps it's the more realistic way to do this.
curl_off_t looks like a long
curl.getinfo(curl_cffi.CurlInfo.SIZE_DOWNLOAD_T) ret_option = { 0x100000: "char**", 0x200000: "long*", 0x300000: "double*", 0x400000: "struct curl_slist **", 0x500000: "long*", 0x600000: "long*" } ret_cast_option = { 0x100000: ffi.string, 0x200000: int, 0x300000: float, 0x500000: int, 0x600000: int, }
Describe the bug Some
CurlInfo
constants can't be retrieved seemingly because types are not supported, such ascurl_off_t
.Raw CURL command
Python attempt
Some more insight
Expected behavior CurlInfo options can be retrieved via
Curl.getinfo
Versions