Viewing File: /lib64/python3.6/ctypes/__pycache__/_endian.cpython-36.pyc
3
\� � @ s� d dl Z d dlT ee�Zdd� ZG dd� dee��Ze jdkr\dZ eZ
G d d
� d
eed�Zn0e jdkr�d
Z eZG dd� deed�Z
ned��dS )� N)�*c C sL t | t�rt| t�S t| t�r.t| j�| j S t| t �r<| S t
d| ��dS )z�Return the type with the 'other' byte order. Simple types like
c_int and so on already have __ctype_be__ and __ctype_le__
attributes which contain the types, for more complicated types
arrays and structures are supported.
z+This type does not support other endian: %sN)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass� Structure� TypeError)�typ� r
�&/usr/lib64/python3.6/ctypes/_endian.pyr s
r c s e Zd Z� fdd�Z� ZS )�
_swapped_metac sb |dkrPg }x>|D ]6}|d }|d }|dd � }|j |t|�f| � qW |}t� j||� d S )NZ_fields_r � � )�appendr �super�__setattr__)�selfZattrname�valueZfieldsZdesc�namer �rest)� __class__r
r r s
z_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r �
__classcell__r
r
)r r r s r �littleZ__ctype_be__c @ s e Zd ZdZf ZdZdS )�BigEndianStructurez$Structure with big endian byte orderN)r r r �__doc__� __slots__�_swappedbytes_r
r
r
r r . s r )� metaclassZbigZ__ctype_le__c @ s e Zd ZdZf ZdZdS )�LittleEndianStructurez'Structure with little endian byte orderN)r r r r r! r"