(
fn: Callable,
ct_fn: "ctypes._FuncPointer",
struct_map: StructMap,
)
| 324 | |
| 325 | |
| 326 | def _solve_func( |
| 327 | fn: Callable, |
| 328 | ct_fn: "ctypes._FuncPointer", |
| 329 | struct_map: StructMap, |
| 330 | ) -> _CFuncTransport: |
| 331 | at = ct_fn._argtypes_ # type: ignore |
| 332 | |
| 333 | @ctypes.CFUNCTYPE(ct_fn._restype_, *at) # type: ignore |
| 334 | def wrapper(*args): |
| 335 | callback_args = [] |
| 336 | |
| 337 | for value, ctype in zip(args, at): |
| 338 | callback_args.append(_decode_type(value, struct_map, ctype)) |
| 339 | |
| 340 | return fn(*callback_args) |
| 341 | |
| 342 | return _CFuncTransport(wrapper, fn) |
| 343 | |
| 344 | |
| 345 | @handle |
no test coverage detected