a 8g+^ @sXdZddlmZddlmZddlmZddlmZddlmZddlm Z dd Z d S) z pyudev._ctypeslib.utils ======================= Utilities for loading ctypeslib. .. moduleauthor:: Anne Mulhern )absolute_import)division)print_function)unicode_literals)CDLL) find_libraryc Csrt|}|std|t|dd}|D]@\}}t||d}|r,|\}} ||_| |_||} | r,| |_q,|S)a{ Load library ``name`` and return a :class:`ctypes.CDLL` object for it. :param str name: the library name :param signatures: signatures of methods :type signatures: dict of str * (tuple of (list of type) * type) :param error_checkers: error checkers for methods :type error_checkers: dict of str * ((int * ptr * arglist) -> int) The library has errno handling enabled. Important functions are given proper signatures and return types to support type checking and argument conversion. :returns: a loaded library :rtype: ctypes.CDLL :raises ImportError: if the library is not found zNo library named %sT)Z use_errnoN) r ImportErrorritemsgetattrargtypesrestypegetZerrcheck) nameZ signaturesZerror_checkersZ library_namelibfuncnameZ signaturefunctionr r Z errorcheckerr;/usr/lib/python3.9/site-packages/pyudev/_ctypeslib/utils.pyload_ctypes_library#s    rN) __doc__Z __future__rrrrZctypesrZ ctypes.utilrrrrrrs