Current File : /home/mmdealscpanel/yummmdeals.com/_ctypeslib.zip
PK05[8��__init__.pynu�[���# -*- coding: utf-8 -*-
# Copyright (C) 2015 mulhern <amulhern@redhat.com>

# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.

# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

"""
    pyudev._ctypeslib
    =================

    Wrappers for libraries.

    .. moduleauthor::  mulhern  <amulhern@redhat.com>
"""

from . import libc
from . import libudev
PK05[E�d(m	m	/__pycache__/_errorcheckers.cpython-36.opt-1.pycnu�[���3

u1�W��@s�dZddlmZddlmZddlmZddlmZddlZddlZddlm	Z	ej
eeje
ejeiZdd	�Zd
d�Zdd
�Zdd�ZdS)zt
    pyudev._ctypeslib._errorcheckers
    ================================

    Error checkers for ctypes wrappers.
�)�absolute_import)�division)�print_function)�unicode_literalsN)�	get_errnocCs2tj|�}tj|�}|dk	r$||�St||�SdS)z�Create an exception from ``errnum``.

    ``errnum`` is an integral error number.

    Return an exception object appropriate to ``errnum``.

    N)�ERRNO_EXCEPTIONS�get�os�strerror�EnvironmentError)�errnumZ	exceptionZerrorstr�r
�$/usr/lib/python3.6/_errorcheckers.py�exception_from_errno+s


rcGs |dkr|}t|��n|SdS)a�Error checker for funtions, which return negative error codes.

    If ``result`` is smaller than ``0``, it is interpreted as negative error
    code, and an appropriate exception is raised:

    - ``-ENOMEM`` raises a :exc:`~exceptions.MemoryError`
    - ``-EOVERFLOW`` raises a :exc:`~exceptions.OverflowError`
    - all other error codes raise :exc:`~exceptions.EnvironmentError`

    If result is greater or equal to ``0``, it is returned unchanged.

    rN)r)�result�func�argsrr
r
r�check_negative_errorcode;s

rcGs"|dkrt�}|dkrt|��|S)z�Error checker to check the system ``errno`` as returned by
    :func:`ctypes.get_errno()`.

    If ``result`` is not ``0``, an exception according to this errno is raised.
    Otherwise nothing happens.

    r)rr)rrrrr
r
r�check_errno_on_nonzero_returnPs
rcGs|st�}|dkrt|��|S)z�Error checker to check the system ``errno`` as returned by
    :func:`ctypes.get_errno()`.

    If ``result`` is a null pointer, an exception according to this errno is
    raised.  Otherwise nothing happens.

    r)rr)rrrrr
r
r�"check_errno_on_null_pointer_return_s
	r)�__doc__Z
__future__rrrrr	�errnoZctypesrZENOMEM�MemoryErrorZ	EOVERFLOW�
OverflowErrorZEINVAL�
ValueErrorrrrrrr
r
r
r�<module>s
PK05[{�j%__pycache__/libc.cpython-36.opt-1.pycnu�[���3

u1�W<�@stdZddlmZddlmZddlmZddlmZddlmZddlm	Z	ed	Z
ee
egefd
�Zee	d
�Z
dS)z�
    pyudev._ctypeslib.libc
    ======================

    Wrappers for libc.

    .. moduleauthor::  Sebastian Wiesner  <lunaryorn@gmail.com>
�)�absolute_import)�division)�print_function)�unicode_literals)�c_int�)�check_errno_on_nonzero_return�)�pipe2N)�__doc__Z
__future__rrrrZctypesrZ_errorcheckersrZfd_pair�dictZ
SIGNATURESZERROR_CHECKERS�r
r
�/usr/lib/python3.6/libc.py�<module>sPK05[s�bqVV&__pycache__/utils.cpython-36.opt-1.pycnu�[���3

u1�W�	�@sXdZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	�Z
d
S)z�
    pyudev._ctypeslib.utils
    =======================

    Utilities for loading ctypeslib.

    .. moduleauthor::  Anne Mulhern  <amulhern@redhat.com>
�)�absolute_import)�division)�print_function)�unicode_literals)�CDLL)�find_librarycCsvt|�}|std|��t|dd�}xL|j�D]@\}}t||d�}|r.|\}}	||_|	|_|j|�}
|
r.|
|_q.W|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�ImportErrorr�items�getattr�argtypes�restype�getZerrcheck)�nameZ
signaturesZerror_checkersZlibrary_name�lib�funcnameZ	signatureZfunctionrrZerrorchecker�r�/usr/lib/python3.6/utils.py�load_ctypes_library$s

rN)�__doc__Z
__future__rrrrZctypesrZctypes.utilrrrrrr�<module>sPK05[{�j__pycache__/libc.cpython-36.pycnu�[���3

u1�W<�@stdZddlmZddlmZddlmZddlmZddlmZddlm	Z	ed	Z
ee
egefd
�Zee	d
�Z
dS)z�
    pyudev._ctypeslib.libc
    ======================

    Wrappers for libc.

    .. moduleauthor::  Sebastian Wiesner  <lunaryorn@gmail.com>
�)�absolute_import)�division)�print_function)�unicode_literals)�c_int�)�check_errno_on_nonzero_return�)�pipe2N)�__doc__Z
__future__rrrrZctypesrZ_errorcheckersrZfd_pair�dictZ
SIGNATURESZERROR_CHECKERS�r
r
�/usr/lib/python3.6/libc.py�<module>sPK05[���\\(__pycache__/libudev.cpython-36.opt-1.pycnu�[���3

u1�W+*�I@sfdZddlmZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddlmZddlm
Z
dd
lmZddlmZddlmZddlmZddlmZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�Z eZ!e"gefegdfegefegefegefegefege	fee	gdfegefegefegdfeege	feege	feeege	feeege	feeege	feege	feege	feege	fege	fege	fegefegefegefegefegefegdfeegefeeegefeee!gefeegefegefegefeeegefegefegefegefegefegefegefegefegefeegefeegefege!fegefegefege	fegefegefegefegefegefeeege	feege	fegefegdfeegefege	fee	ge	fege	fegefeeege	feege	fege	fege	fe ge fe gdfege fe ee
gefd �FZ#e"dddddddddddddddddddddddddddddeeeeeeeeeeddddddddddddddddeeedeeeedddddddd!�FZ$dS)"z�
    pyudev._ctypeslib.libudev
    =========================

    Wrapper types for libudev.  Use ``libudev`` attribute to access libudev
    functions.

    .. moduleauthor::  Sebastian Wiesner  <lunaryorn@gmail.com>
�)�absolute_import)�division)�print_function)�unicode_literals)�c_char)�c_char_p)�c_int)�c_uint)�c_ulonglong)�CDLL)�	Structure)�POINTER)�find_library�)�check_errno_on_nonzero_return)�"check_errno_on_null_pointer_return)�check_negative_errorcodec@seZdZdZdS)�udevz'
    Dummy for ``udev`` structure.
    N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib/python3.6/libudev.pyr2src@seZdZdZdS)�udev_enumeratez1
    Dummy for ``udev_enumerate`` structure.
    N)rrrrrrrrr<src@seZdZdZdS)�udev_list_entryz2
    Dummy for ``udev_list_entry`` structure.
    N)rrrrrrrrrFsrc@seZdZdZdS)�udev_devicez.
    Dummy for ``udev_device`` structure.
    N)rrrrrrrrrPsrc@seZdZdZdS)�udev_monitorz.
    Dummy for ``udev_device`` structure.
    N)rrrrrrrrrZsrc@seZdZdZdS)�	udev_hwdbz,
    Dummy for ``udev_hwdb`` structure.
    N)rrrrrrrrrcsrN)F�udev_new�
udev_unref�udev_ref�udev_get_sys_path�udev_get_dev_path�udev_get_run_path�udev_get_log_priority�udev_set_log_priority�udev_enumerate_new�udev_enumerate_ref�udev_enumerate_unref�"udev_enumerate_add_match_subsystem�$udev_enumerate_add_nomatch_subsystem�!udev_enumerate_add_match_property� udev_enumerate_add_match_sysattr�"udev_enumerate_add_nomatch_sysattr�udev_enumerate_add_match_tag� udev_enumerate_add_match_sysname�udev_enumerate_add_match_parent�'udev_enumerate_add_match_is_initialized�udev_enumerate_scan_devices�udev_enumerate_get_list_entry�udev_list_entry_get_next�udev_list_entry_get_name�udev_list_entry_get_value�udev_device_ref�udev_device_unref�udev_device_new_from_syspath�&udev_device_new_from_subsystem_sysname�udev_device_new_from_devnum�udev_device_new_from_device_id� udev_device_new_from_environment�udev_device_get_parent�-udev_device_get_parent_with_subsystem_devtype�udev_device_get_devpath�udev_device_get_subsystem�udev_device_get_syspath�udev_device_get_sysnum�udev_device_get_sysname�udev_device_get_driver�udev_device_get_devtype�udev_device_get_devnode�udev_device_get_property_value�udev_device_get_sysattr_value�udev_device_get_devnum�udev_device_get_action�udev_device_get_seqnum�udev_device_get_is_initialized�&udev_device_get_usec_since_initialized�#udev_device_get_devlinks_list_entry�udev_device_get_tags_list_entry�%udev_device_get_properties_list_entry�"udev_device_get_sysattr_list_entry�udev_device_set_sysattr_value�udev_device_has_tag�udev_monitor_ref�udev_monitor_unref�udev_monitor_new_from_netlink�udev_monitor_enable_receiving�$udev_monitor_set_receive_buffer_size�udev_monitor_get_fd�udev_monitor_receive_device�/udev_monitor_filter_add_match_subsystem_devtype�!udev_monitor_filter_add_match_tag�udev_monitor_filter_update�udev_monitor_filter_remove�
udev_hwdb_ref�udev_hwdb_unref�
udev_hwdb_new�#udev_hwdb_get_properties_list_entry)FrLrPrHrKrArGrFrNr?r@rRrIrMrBrSrJrErDrCrQrOrUr=r<r>r;r:r8r9rTr1r*r+r,r-r.r/r0r2r4r'r(r3r)r#r%r$r"rdrcrarbr6r5r7rZrYr\rVr]r^r_r`r[rXrWrr!r&r )%rZ
__future__rrrrZctypesrrrr	r
rrr
Zctypes.utilrZ_errorcheckersrrrrZudev_prZudev_enumerate_prZudev_list_entry_prZ
udev_device_prZudev_monitor_prZudev_hwdb_pZdev_t�dictZ
SIGNATURESZERROR_CHECKERSrrrr�<module>sb














PK05[�$�>>#__pycache__/__init__.cpython-36.pycnu�[���3

H�V��@s dZddlmZddlmZdS)z�
    pyudev._ctypeslib
    =================

    Wrappers for libraries.

    .. moduleauthor::  mulhern  <amulhern@redhat.com>
�)�libc)�libudevN)�__doc__�rr�rr�/usr/lib/python3.6/__init__.py�<module>sPK05[�$�>>)__pycache__/__init__.cpython-36.opt-1.pycnu�[���3

H�V��@s dZddlmZddlmZdS)z�
    pyudev._ctypeslib
    =================

    Wrappers for libraries.

    .. moduleauthor::  mulhern  <amulhern@redhat.com>
�)�libc)�libudevN)�__doc__�rr�rr�/usr/lib/python3.6/__init__.py�<module>sPK05[���\\"__pycache__/libudev.cpython-36.pycnu�[���3

u1�W+*�I@sfdZddlmZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddlmZddlm
Z
dd
lmZddlmZddlmZddlmZddlmZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�ZGdd�de
�Zee�Z eZ!e"gefegdfegefegefegefegefege	fee	gdfegefegefegdfeege	feege	feeege	feeege	feeege	feege	feege	feege	fege	fege	fegefegefegefegefegefegdfeegefeeegefeee!gefeegefegefegefeeegefegefegefegefegefegefegefegefegefeegefeegefege!fegefegefege	fegefegefegefegefegefeeege	feege	fegefegdfeegefege	fee	ge	fege	fegefeeege	feege	fege	fege	fe ge fe gdfege fe ee
gefd �FZ#e"dddddddddddddddddddddddddddddeeeeeeeeeeddddddddddddddddeeedeeeedddddddd!�FZ$dS)"z�
    pyudev._ctypeslib.libudev
    =========================

    Wrapper types for libudev.  Use ``libudev`` attribute to access libudev
    functions.

    .. moduleauthor::  Sebastian Wiesner  <lunaryorn@gmail.com>
�)�absolute_import)�division)�print_function)�unicode_literals)�c_char)�c_char_p)�c_int)�c_uint)�c_ulonglong)�CDLL)�	Structure)�POINTER)�find_library�)�check_errno_on_nonzero_return)�"check_errno_on_null_pointer_return)�check_negative_errorcodec@seZdZdZdS)�udevz'
    Dummy for ``udev`` structure.
    N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib/python3.6/libudev.pyr2src@seZdZdZdS)�udev_enumeratez1
    Dummy for ``udev_enumerate`` structure.
    N)rrrrrrrrr<src@seZdZdZdS)�udev_list_entryz2
    Dummy for ``udev_list_entry`` structure.
    N)rrrrrrrrrFsrc@seZdZdZdS)�udev_devicez.
    Dummy for ``udev_device`` structure.
    N)rrrrrrrrrPsrc@seZdZdZdS)�udev_monitorz.
    Dummy for ``udev_device`` structure.
    N)rrrrrrrrrZsrc@seZdZdZdS)�	udev_hwdbz,
    Dummy for ``udev_hwdb`` structure.
    N)rrrrrrrrrcsrN)F�udev_new�
udev_unref�udev_ref�udev_get_sys_path�udev_get_dev_path�udev_get_run_path�udev_get_log_priority�udev_set_log_priority�udev_enumerate_new�udev_enumerate_ref�udev_enumerate_unref�"udev_enumerate_add_match_subsystem�$udev_enumerate_add_nomatch_subsystem�!udev_enumerate_add_match_property� udev_enumerate_add_match_sysattr�"udev_enumerate_add_nomatch_sysattr�udev_enumerate_add_match_tag� udev_enumerate_add_match_sysname�udev_enumerate_add_match_parent�'udev_enumerate_add_match_is_initialized�udev_enumerate_scan_devices�udev_enumerate_get_list_entry�udev_list_entry_get_next�udev_list_entry_get_name�udev_list_entry_get_value�udev_device_ref�udev_device_unref�udev_device_new_from_syspath�&udev_device_new_from_subsystem_sysname�udev_device_new_from_devnum�udev_device_new_from_device_id� udev_device_new_from_environment�udev_device_get_parent�-udev_device_get_parent_with_subsystem_devtype�udev_device_get_devpath�udev_device_get_subsystem�udev_device_get_syspath�udev_device_get_sysnum�udev_device_get_sysname�udev_device_get_driver�udev_device_get_devtype�udev_device_get_devnode�udev_device_get_property_value�udev_device_get_sysattr_value�udev_device_get_devnum�udev_device_get_action�udev_device_get_seqnum�udev_device_get_is_initialized�&udev_device_get_usec_since_initialized�#udev_device_get_devlinks_list_entry�udev_device_get_tags_list_entry�%udev_device_get_properties_list_entry�"udev_device_get_sysattr_list_entry�udev_device_set_sysattr_value�udev_device_has_tag�udev_monitor_ref�udev_monitor_unref�udev_monitor_new_from_netlink�udev_monitor_enable_receiving�$udev_monitor_set_receive_buffer_size�udev_monitor_get_fd�udev_monitor_receive_device�/udev_monitor_filter_add_match_subsystem_devtype�!udev_monitor_filter_add_match_tag�udev_monitor_filter_update�udev_monitor_filter_remove�
udev_hwdb_ref�udev_hwdb_unref�
udev_hwdb_new�#udev_hwdb_get_properties_list_entry)FrLrPrHrKrArGrFrNr?r@rRrIrMrBrSrJrErDrCrQrOrUr=r<r>r;r:r8r9rTr1r*r+r,r-r.r/r0r2r4r'r(r3r)r#r%r$r"rdrcrarbr6r5r7rZrYr\rVr]r^r_r`r[rXrWrr!r&r )%rZ
__future__rrrrZctypesrrrr	r
rrr
Zctypes.utilrZ_errorcheckersrrrrZudev_prZudev_enumerate_prZudev_list_entry_prZ
udev_device_prZudev_monitor_prZudev_hwdb_pZdev_t�dictZ
SIGNATURESZERROR_CHECKERSrrrr�<module>sb














PK05[E�d(m	m	)__pycache__/_errorcheckers.cpython-36.pycnu�[���3

u1�W��@s�dZddlmZddlmZddlmZddlmZddlZddlZddlm	Z	ej
eeje
ejeiZdd	�Zd
d�Zdd
�Zdd�ZdS)zt
    pyudev._ctypeslib._errorcheckers
    ================================

    Error checkers for ctypes wrappers.
�)�absolute_import)�division)�print_function)�unicode_literalsN)�	get_errnocCs2tj|�}tj|�}|dk	r$||�St||�SdS)z�Create an exception from ``errnum``.

    ``errnum`` is an integral error number.

    Return an exception object appropriate to ``errnum``.

    N)�ERRNO_EXCEPTIONS�get�os�strerror�EnvironmentError)�errnumZ	exceptionZerrorstr�r
�$/usr/lib/python3.6/_errorcheckers.py�exception_from_errno+s


rcGs |dkr|}t|��n|SdS)a�Error checker for funtions, which return negative error codes.

    If ``result`` is smaller than ``0``, it is interpreted as negative error
    code, and an appropriate exception is raised:

    - ``-ENOMEM`` raises a :exc:`~exceptions.MemoryError`
    - ``-EOVERFLOW`` raises a :exc:`~exceptions.OverflowError`
    - all other error codes raise :exc:`~exceptions.EnvironmentError`

    If result is greater or equal to ``0``, it is returned unchanged.

    rN)r)�result�func�argsrr
r
r�check_negative_errorcode;s

rcGs"|dkrt�}|dkrt|��|S)z�Error checker to check the system ``errno`` as returned by
    :func:`ctypes.get_errno()`.

    If ``result`` is not ``0``, an exception according to this errno is raised.
    Otherwise nothing happens.

    r)rr)rrrrr
r
r�check_errno_on_nonzero_returnPs
rcGs|st�}|dkrt|��|S)z�Error checker to check the system ``errno`` as returned by
    :func:`ctypes.get_errno()`.

    If ``result`` is a null pointer, an exception according to this errno is
    raised.  Otherwise nothing happens.

    r)rr)rrrrr
r
r�"check_errno_on_null_pointer_return_s
	r)�__doc__Z
__future__rrrrr	�errnoZctypesrZENOMEM�MemoryErrorZ	EOVERFLOW�
OverflowErrorZEINVAL�
ValueErrorrrrrrr
r
r
r�<module>s
PK05[s�bqVV __pycache__/utils.cpython-36.pycnu�[���3

u1�W�	�@sXdZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	�Z
d
S)z�
    pyudev._ctypeslib.utils
    =======================

    Utilities for loading ctypeslib.

    .. moduleauthor::  Anne Mulhern  <amulhern@redhat.com>
�)�absolute_import)�division)�print_function)�unicode_literals)�CDLL)�find_librarycCsvt|�}|std|��t|dd�}xL|j�D]@\}}t||d�}|r.|\}}	||_|	|_|j|�}
|
r.|
|_q.W|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�ImportErrorr�items�getattr�argtypes�restype�getZerrcheck)�nameZ
signaturesZerror_checkersZlibrary_name�lib�funcnameZ	signatureZfunctionrrZerrorchecker�r�/usr/lib/python3.6/utils.py�load_ctypes_library$s

rN)�__doc__Z
__future__rrrrZctypesrZctypes.utilrrrrrr�<module>sPK05[{��0+*+*
libudev.pynu�[���# -*- coding: utf-8 -*-
# Copyright (C) 2010, 2011, 2012, 2013 Sebastian Wiesner <lunaryorn@gmail.com>

# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.

# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA


"""
    pyudev._ctypeslib.libudev
    =========================

    Wrapper types for libudev.  Use ``libudev`` attribute to access libudev
    functions.

    .. moduleauthor::  Sebastian Wiesner  <lunaryorn@gmail.com>
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from ctypes import c_char
from ctypes import c_char_p
from ctypes import c_int
from ctypes import c_uint
from ctypes import c_ulonglong
from ctypes import CDLL
from ctypes import Structure
from ctypes import POINTER

from ctypes.util import find_library

from ._errorcheckers import check_errno_on_nonzero_return
from ._errorcheckers import check_errno_on_null_pointer_return
from ._errorcheckers import check_negative_errorcode


class udev(Structure): # pylint: disable=invalid-name
    """
    Dummy for ``udev`` structure.
    """
    # pylint: disable=too-few-public-methods
    pass

udev_p = POINTER(udev) # pylint: disable=invalid-name


class udev_enumerate(Structure): # pylint: disable=invalid-name
    """
    Dummy for ``udev_enumerate`` structure.
    """
    # pylint: disable=too-few-public-methods
    pass

udev_enumerate_p = POINTER(udev_enumerate) # pylint: disable=invalid-name


class udev_list_entry(Structure): # pylint: disable=invalid-name
    """
    Dummy for ``udev_list_entry`` structure.
    """
    # pylint: disable=too-few-public-methods
    pass

udev_list_entry_p = POINTER(udev_list_entry) # pylint: disable=invalid-name


class udev_device(Structure): # pylint: disable=invalid-name
    """
    Dummy for ``udev_device`` structure.
    """
    # pylint: disable=too-few-public-methods
    pass

udev_device_p = POINTER(udev_device) # pylint: disable=invalid-name


class udev_monitor(Structure): # pylint: disable=invalid-name
    """
    Dummy for ``udev_device`` structure.
    """
    # pylint: disable=too-few-public-methods
    pass

udev_monitor_p = POINTER(udev_monitor) # pylint: disable=invalid-name

class udev_hwdb(Structure): # pylint: disable=invalid-name
    """
    Dummy for ``udev_hwdb`` structure.
    """
    # pylint: disable=too-few-public-methods
    pass

udev_hwdb_p = POINTER(udev_hwdb) # pylint: disable=invalid-name


dev_t = c_ulonglong # pylint: disable=invalid-name


SIGNATURES = dict(
   # context
   udev_new=([], udev_p),
   udev_unref=([udev_p], None),
   udev_ref=([udev_p], udev_p),
   udev_get_sys_path=([udev_p], c_char_p),
   udev_get_dev_path=([udev_p], c_char_p),
   udev_get_run_path=([udev_p], c_char_p),
   udev_get_log_priority=([udev_p], c_int),
   udev_set_log_priority=([udev_p, c_int], None),
   udev_enumerate_new=([udev_p], udev_enumerate_p),
   udev_enumerate_ref=([udev_enumerate_p], udev_enumerate_p),
   udev_enumerate_unref=([udev_enumerate_p], None),
   udev_enumerate_add_match_subsystem=([udev_enumerate_p, c_char_p], c_int),
   udev_enumerate_add_nomatch_subsystem=([udev_enumerate_p, c_char_p], c_int),
   udev_enumerate_add_match_property=(
      [udev_enumerate_p, c_char_p, c_char_p],
      c_int
   ),
   udev_enumerate_add_match_sysattr=(
      [udev_enumerate_p, c_char_p, c_char_p],
      c_int
   ),
   udev_enumerate_add_nomatch_sysattr=(
      [udev_enumerate_p, c_char_p, c_char_p],
      c_int
   ),
   udev_enumerate_add_match_tag=([udev_enumerate_p, c_char_p], c_int),
   udev_enumerate_add_match_sysname=([udev_enumerate_p, c_char_p], c_int),
   udev_enumerate_add_match_parent=([udev_enumerate_p, udev_device_p], c_int),
   udev_enumerate_add_match_is_initialized=([udev_enumerate_p], c_int),
   udev_enumerate_scan_devices=([udev_enumerate_p], c_int),
   udev_enumerate_get_list_entry=([udev_enumerate_p], udev_list_entry_p),
   # list entries
   udev_list_entry_get_next=([udev_list_entry_p], udev_list_entry_p),
   udev_list_entry_get_name=([udev_list_entry_p], c_char_p),
   udev_list_entry_get_value=([udev_list_entry_p], c_char_p),
   # devices
   udev_device_ref=([udev_device_p], udev_device_p),
   udev_device_unref=([udev_device_p], None),
   udev_device_new_from_syspath=([udev_p, c_char_p], udev_device_p),
   udev_device_new_from_subsystem_sysname=(
      [udev_p, c_char_p, c_char_p],
      udev_device_p
   ),
   udev_device_new_from_devnum=([udev_p, c_char, dev_t], udev_device_p),
   udev_device_new_from_device_id=([udev_p, c_char_p], udev_device_p),
   udev_device_new_from_environment=([udev_p], udev_device_p),
   udev_device_get_parent=([udev_device_p], udev_device_p),
   udev_device_get_parent_with_subsystem_devtype=(
      [udev_device_p, c_char_p, c_char_p],
      udev_device_p
   ),
   udev_device_get_devpath=([udev_device_p], c_char_p),
   udev_device_get_subsystem=([udev_device_p], c_char_p),
   udev_device_get_syspath=([udev_device_p], c_char_p),
   udev_device_get_sysnum=([udev_device_p], c_char_p),
   udev_device_get_sysname=([udev_device_p], c_char_p),
   udev_device_get_driver=([udev_device_p], c_char_p),
   udev_device_get_devtype=([udev_device_p], c_char_p),
   udev_device_get_devnode=([udev_device_p], c_char_p),
   udev_device_get_property_value=([udev_device_p, c_char_p], c_char_p),
   udev_device_get_sysattr_value=([udev_device_p, c_char_p], c_char_p),
   udev_device_get_devnum=([udev_device_p], dev_t),
   udev_device_get_action=([udev_device_p], c_char_p),
   udev_device_get_seqnum=([udev_device_p], c_ulonglong),
   udev_device_get_is_initialized=([udev_device_p], c_int),
   udev_device_get_usec_since_initialized=([udev_device_p], c_ulonglong),
   udev_device_get_devlinks_list_entry=([udev_device_p], udev_list_entry_p),
   udev_device_get_tags_list_entry=([udev_device_p], udev_list_entry_p),
   udev_device_get_properties_list_entry=([udev_device_p], udev_list_entry_p),
   udev_device_get_sysattr_list_entry=([udev_device_p], udev_list_entry_p),
   udev_device_set_sysattr_value=([udev_device_p, c_char_p, c_char_p], c_int),
   udev_device_has_tag=([udev_device_p, c_char_p], c_int),
   # monitoring
   udev_monitor_ref=([udev_monitor_p], udev_monitor_p),
   udev_monitor_unref=([udev_monitor_p], None),
   udev_monitor_new_from_netlink=([udev_p, c_char_p], udev_monitor_p),
   udev_monitor_enable_receiving=([udev_monitor_p], c_int),
   udev_monitor_set_receive_buffer_size=([udev_monitor_p, c_int], c_int),
   udev_monitor_get_fd=([udev_monitor_p], c_int),
   udev_monitor_receive_device=([udev_monitor_p], udev_device_p),
   udev_monitor_filter_add_match_subsystem_devtype=(
           [udev_monitor_p, c_char_p, c_char_p], c_int),
   udev_monitor_filter_add_match_tag=([udev_monitor_p, c_char_p], c_int),
   udev_monitor_filter_update=([udev_monitor_p], c_int),
   udev_monitor_filter_remove=([udev_monitor_p], c_int),
   # hwdb
   udev_hwdb_ref=([udev_hwdb_p], udev_hwdb_p),
   udev_hwdb_unref=([udev_hwdb_p], None),
   udev_hwdb_new=([udev_p], udev_hwdb_p),
   udev_hwdb_get_properties_list_entry=(
      [udev_hwdb_p, c_char_p, c_uint],
      udev_list_entry_p
   )
)


ERROR_CHECKERS = dict(
   udev_device_get_action=None,
   udev_device_get_devlinks_list_entry=None,
   udev_device_get_devnode=None,
   udev_device_get_devnum=None,
   udev_device_get_devpath=None,
   udev_device_get_devtype=None,
   udev_device_get_driver=None,
   udev_device_get_is_initialized=None,
   udev_device_get_parent=None,
   udev_device_get_parent_with_subsystem_devtype=None,
   udev_device_get_properties_list_entry=None,
   udev_device_get_property_value=None,
   udev_device_get_seqnum=None,
   udev_device_get_subsystem=None,
   udev_device_get_sysattr_list_entry=None,
   udev_device_get_sysattr_value=None,
   udev_device_get_sysname=None,
   udev_device_get_sysnum=None,
   udev_device_get_syspath=None,
   udev_device_get_tags_list_entry=None,
   udev_device_get_usec_since_initialized=None,
   udev_device_has_tag=None,
   udev_device_new_from_device_id=None,
   udev_device_new_from_devnum=None,
   udev_device_new_from_environment=None,
   udev_device_new_from_subsystem_sysname=None,
   udev_device_new_from_syspath=None,
   udev_device_ref=None,
   udev_device_unref=None,
   udev_device_set_sysattr_value=check_negative_errorcode,
   udev_enumerate_add_match_parent=check_negative_errorcode,
   udev_enumerate_add_match_subsystem=check_negative_errorcode,
   udev_enumerate_add_nomatch_subsystem=check_negative_errorcode,
   udev_enumerate_add_match_property=check_negative_errorcode,
   udev_enumerate_add_match_sysattr=check_negative_errorcode,
   udev_enumerate_add_nomatch_sysattr=check_negative_errorcode,
   udev_enumerate_add_match_tag=check_negative_errorcode,
   udev_enumerate_add_match_sysname=check_negative_errorcode,
   udev_enumerate_add_match_is_initialized=check_negative_errorcode,
   udev_enumerate_get_list_entry=None,
   udev_enumerate_new=None,
   udev_enumerate_ref=None,
   udev_enumerate_scan_devices=None,
   udev_enumerate_unref=None,
   udev_get_dev_path=None,
   udev_get_log_priority=None,
   udev_get_run_path=None,
   udev_get_sys_path=None,
   udev_hwdb_get_properties_list_entry=None,
   udev_hwdb_new=None,
   udev_hwdb_ref=None,
   udev_hwdb_unref=None,
   udev_list_entry_get_name=None,
   udev_list_entry_get_next=None,
   udev_list_entry_get_value=None,
   udev_monitor_set_receive_buffer_size=check_errno_on_nonzero_return,
   # libudev doc says, enable_receiving returns a negative errno, but tests
   # show that this is not reliable, so query the real error code
   udev_monitor_enable_receiving=check_errno_on_nonzero_return,
   udev_monitor_receive_device=check_errno_on_null_pointer_return,
   udev_monitor_ref=None,
   udev_monitor_filter_add_match_subsystem_devtype=check_negative_errorcode,
   udev_monitor_filter_add_match_tag=check_negative_errorcode,
   udev_monitor_filter_update=check_errno_on_nonzero_return,
   udev_monitor_filter_remove=check_errno_on_nonzero_return,
   udev_monitor_get_fd=None,
   udev_monitor_new_from_netlink=None,
   udev_monitor_unref=None,
   udev_new=None,
   udev_ref=None,
   udev_set_log_priority=None,
   udev_unref=None
)
PK05[6���	�	utils.pynu�[���# -*- coding: utf-8 -*-
# Copyright (C) 2013 Sebastian Wiesner <lunaryorn@gmail.com>

# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.

# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

"""
    pyudev._ctypeslib.utils
    =======================

    Utilities for loading ctypeslib.

    .. moduleauthor::  Anne Mulhern  <amulhern@redhat.com>
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from ctypes import CDLL
from ctypes.util import find_library


def load_ctypes_library(name, signatures, error_checkers):
    """
    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
    """
    library_name = find_library(name)
    if not library_name:
        raise ImportError('No library named %s' % name)
    lib = CDLL(library_name, use_errno=True)
    # Add function signatures
    for funcname, signature in signatures.items():
        function = getattr(lib, funcname, None)
        if function:
            argtypes, restype = signature
            function.argtypes = argtypes
            function.restype = restype
            errorchecker = error_checkers.get(funcname)
            if errorchecker:
                function.errcheck = errorchecker
    return lib
PK05[�`�<<libc.pynu�[���# -*- coding: utf-8 -*-
# Copyright (C) 2013 Sebastian Wiesner <lunaryorn@gmail.com>

# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.

# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

"""
    pyudev._ctypeslib.libc
    ======================

    Wrappers for libc.

    .. moduleauthor::  Sebastian Wiesner  <lunaryorn@gmail.com>
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

from ctypes import c_int

from ._errorcheckers import check_errno_on_nonzero_return


fd_pair = c_int * 2


SIGNATURES = dict(
   pipe2=([fd_pair, c_int], c_int),
)

ERROR_CHECKERS = dict(
   pipe2=check_errno_on_nonzero_return,
)
PK05[�|/Y��_errorcheckers.pynu�[���# -*- coding: utf-8 -*-
# Copyright (C) 2013 Sebastian Wiesner <lunaryorn@gmail.com>

# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version.

# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
# for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

"""
    pyudev._ctypeslib._errorcheckers
    ================================

    Error checkers for ctypes wrappers.
"""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals


import os
import errno
from ctypes import get_errno


ERRNO_EXCEPTIONS = {
    errno.ENOMEM: MemoryError,
    errno.EOVERFLOW: OverflowError,
    errno.EINVAL: ValueError
}


def exception_from_errno(errnum):
    """Create an exception from ``errnum``.

    ``errnum`` is an integral error number.

    Return an exception object appropriate to ``errnum``.

    """
    exception = ERRNO_EXCEPTIONS.get(errnum)
    errorstr = os.strerror(errnum)
    if exception is not None:
        return exception(errorstr)
    else:
        return EnvironmentError(errnum, errorstr)


def check_negative_errorcode(result, func, *args):
    """Error checker for funtions, which return negative error codes.

    If ``result`` is smaller than ``0``, it is interpreted as negative error
    code, and an appropriate exception is raised:

    - ``-ENOMEM`` raises a :exc:`~exceptions.MemoryError`
    - ``-EOVERFLOW`` raises a :exc:`~exceptions.OverflowError`
    - all other error codes raise :exc:`~exceptions.EnvironmentError`

    If result is greater or equal to ``0``, it is returned unchanged.

    """
    if result < 0:
        # udev returns the *negative* errno code at this point
        errnum = -result
        raise exception_from_errno(errnum)
    else:
        return result


def check_errno_on_nonzero_return(result, func, *args):
    """Error checker to check the system ``errno`` as returned by
    :func:`ctypes.get_errno()`.

    If ``result`` is not ``0``, an exception according to this errno is raised.
    Otherwise nothing happens.

    """
    if result != 0:
        errnum = get_errno()
        if errnum != 0:
            raise exception_from_errno(errnum)
    return result


def check_errno_on_null_pointer_return(result, func, *args):
    """Error checker to check the system ``errno`` as returned by
    :func:`ctypes.get_errno()`.

    If ``result`` is a null pointer, an exception according to this errno is
    raised.  Otherwise nothing happens.

    """
    # pylint: disable=invalid-name
    if not result:
        errnum = get_errno()
        if errnum != 0:
            raise exception_from_errno(errnum)
    return result
PK05[8��__init__.pynu�[���PK05[E�d(m	m	/
__pycache__/_errorcheckers.cpython-36.opt-1.pycnu�[���PK05[{�j%�
__pycache__/libc.cpython-36.opt-1.pycnu�[���PK05[s�bqVV&�__pycache__/utils.cpython-36.opt-1.pycnu�[���PK05[{�jV__pycache__/libc.cpython-36.pycnu�[���PK05[���\\($__pycache__/libudev.cpython-36.opt-1.pycnu�[���PK05[�$�>>#�0__pycache__/__init__.cpython-36.pycnu�[���PK05[�$�>>)i2__pycache__/__init__.cpython-36.opt-1.pycnu�[���PK05[���\\"4__pycache__/libudev.cpython-36.pycnu�[���PK05[E�d(m	m	)�J__pycache__/_errorcheckers.cpython-36.pycnu�[���PK05[s�bqVV tT__pycache__/utils.cpython-36.pycnu�[���PK05[{��0+*+*
[libudev.pynu�[���PK05[6���	�	�utils.pynu�[���PK05[�`�<<`�libc.pynu�[���PK05[�|/Y��Ӕ_errorcheckers.pynu�[���PKm��