Viewing File: /lib64/python3.8/ctypes/__pycache__/_endian.cpython-38.pyc
U
e5d� � @ 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.8/ctypes/_endian.pyr s
r c s e Zd Z� fdd�Z� ZS )�
_swapped_metac s^ |dkrLg }|D ]6}|d }|d }|dd � }|� |t|�f| � q|}t� �||� d S )NZ_fields_r � � )�appendr �super�__setattr__)�self�attrname�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 ZdZdZdZdS )�BigEndianStructurez$Structure with big endian byte orderr
N�r r r �__doc__� __slots__Z_swappedbytes_r
r
r
r r! . s r! )� metaclassZbigZ__ctype_le__c @ s e Zd ZdZdZdZdS )�LittleEndianStructurez'Structure with little endian byte orderr
Nr"