Function
_register
(
name: str,
restype: Optional[CData],
argtypes: Optional[Tuple[CData, ...]] = None,
*,
minver: Optional[str] = None,
)
Source from the content-addressed store, hash-verified
| 13 | |
| 14 | |
| 15 | def _register( |
| 16 | name: str, |
| 17 | restype: Optional[CData], |
| 18 | argtypes: Optional[Tuple[CData, ...]] = None, |
| 19 | *, |
| 20 | minver: Optional[str] = None, |
| 21 | ) -> None: |
| 22 | func: Optional["ctypes._NamedFuncPointer"] = getattr(dll, name, None) |
| 23 | |
| 24 | if func: |
| 25 | func.argtypes = argtypes # type: ignore |
| 26 | func.restype = restype |
| 27 | |
| 28 | API_FUNCS[name] = (func, minver, name) |
| 29 | |
| 30 | |
| 31 | class PyTypeObject(ctypes.Structure): |
Tested by
no test coverage detected