@@ -2,6 +2,7 @@ import sys
2
2
from _ctypes import (
3
3
RTLD_GLOBAL as RTLD_GLOBAL ,
4
4
RTLD_LOCAL as RTLD_LOCAL ,
5
+ ArgumentError as ArgumentError ,
5
6
Array as Array ,
6
7
Structure as Structure ,
7
8
Union as Union ,
@@ -11,6 +12,12 @@ from _ctypes import (
11
12
_SimpleCData as _SimpleCData ,
12
13
_StructUnionBase as _StructUnionBase ,
13
14
_StructUnionMeta as _StructUnionMeta ,
15
+ addressof as addressof ,
16
+ alignment as alignment ,
17
+ get_errno as get_errno ,
18
+ resize as resize ,
19
+ set_errno as set_errno ,
20
+ sizeof as sizeof ,
14
21
)
15
22
from collections .abc import Callable , Sequence
16
23
from typing import Any , ClassVar , Generic , TypeVar , overload
@@ -101,8 +108,6 @@ class _FuncPointer(_PointerLike, _CData):
101
108
class _NamedFuncPointer (_FuncPointer ):
102
109
__name__ : str
103
110
104
- class ArgumentError (Exception ): ...
105
-
106
111
def CFUNCTYPE (
107
112
restype : type [_CData ] | None , * argtypes : type [_CData ], use_errno : bool = ..., use_last_error : bool = ...
108
113
) -> type [_FuncPointer ]: ...
@@ -125,8 +130,6 @@ _CVoidPLike: TypeAlias = _PointerLike | Array[Any] | _CArgObject | int
125
130
# when memmove(buf, b'foo', 4) was intended.
126
131
_CVoidConstPLike : TypeAlias = _CVoidPLike | bytes
127
132
128
- def addressof (obj : _CData ) -> int : ...
129
- def alignment (obj_or_type : _CData | type [_CData ]) -> int : ...
130
133
def byref (obj : _CData , offset : int = ...) -> _CArgObject : ...
131
134
132
135
_CastT = TypeVar ("_CastT" , bound = _CanCastTo )
@@ -143,7 +146,6 @@ if sys.platform == "win32":
143
146
def DllGetClassObject (rclsid : Any , riid : Any , ppv : Any ) -> int : ... # TODO not documented
144
147
def GetLastError () -> int : ...
145
148
146
- def get_errno () -> int : ...
147
149
def memmove (dst : _CVoidPLike , src : _CVoidConstPLike , count : int ) -> int : ...
148
150
def memset (dst : _CVoidPLike , c : int , count : int ) -> int : ...
149
151
def POINTER (type : type [_CT ]) -> type [_Pointer [_CT ]]: ...
@@ -162,9 +164,6 @@ class _Pointer(Generic[_CT], _PointerLike, _CData):
162
164
def __setitem__ (self , __key : int , __value : Any ) -> None : ...
163
165
164
166
def pointer (__arg : _CT ) -> _Pointer [_CT ]: ...
165
- def resize (obj : _CData , size : int ) -> None : ...
166
- def set_errno (value : int ) -> int : ...
167
- def sizeof (obj_or_type : _CData | type [_CData ]) -> int : ...
168
167
def string_at (address : _CVoidConstPLike , size : int = - 1 ) -> bytes : ...
169
168
170
169
if sys .platform == "win32" :
0 commit comments