MCPcopy Index your code
hub / github.com/ZeroIntensity/pointers.py / _solve_func

Function _solve_func

src/pointers/bindings.py:326–342  ·  view source on GitHub ↗
(
    fn: Callable,
    ct_fn: "ctypes._FuncPointer",
    struct_map: StructMap,
)

Source from the content-addressed store, hash-verified

324
325
326def _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

Callers 1

binding_baseFunction · 0.85

Calls 1

_CFuncTransportClass · 0.85

Tested by

no test coverage detected