def load_call_dict(call_dict, lib):
"""Loads argument/return types from the call dictionary
@param call_dict: call dictionary. Keyed by function name;
values are [return type, argtype0, argtype 1...]
@type call_dict: dict
@param lib: library where functions specified in L{call_dict} live.
@type lib: ctypes.WinDLL or ctypes.CDLL
"""
for funcname in call_dict:
func = getattr(lib, funcname)
args = call_dict[funcname]
func.restype = args[0]
if len(args) <= 1:
func.argtypes = None
else:
func.argtypes = args[1:]
评论列表
文章目录