
    daf	                     V   d dl Z d dl  ee      Zd Z G d d      Z G d de ee            Z G d d	e ee	            Z
e j                  d
k(  r!dZeZ G d dee      Ze	Z G d de	e
      Zye j                  dk(  r!dZeZ G d dee      Ze	Z G d de	e
      Zy ed      )    N)*c                     t        | t              rt        | t              S t        | t              r"t        | j                        | j                  z  S t        | t        t        f      r| S t        d| z        )zReturn 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: %s)hasattr_OTHER_ENDIANgetattr
isinstance_array_type_other_endian_type__length_
issubclass	StructureUnion	TypeError)typs    )/root/Python-3.12.4/Lib/ctypes/_endian.pyr
   r
      sb     sM"sM**#{#SZZ(3<<77#	5)*

ACG
HH    c                        e Zd Z fdZ xZS )_swapped_metac                     |dk(  r9g }|D ]0  }|d   }|d   }|dd  }|j                  |t        |      f|z          2 |}t        |   ||       y )N_fields_r         )appendr
   super__setattr__)	selfattrnamevaluefieldsdescnamer   rest	__class__s	           r   r   z_swapped_meta.__setattr__   so    z!F AAw1gABxt]3%784?@	A
 EHe,r   )__name__
__module____qualname__r   __classcell__)r$   s   @r   r   r      s    	- 	-r   r   c                       e Zd Zy)_swapped_struct_metaNr%   r&   r'    r   r   r*   r*   "       r   r*   c                       e Zd Zy)_swapped_union_metaNr+   r,   r   r   r/   r/   #   r-   r   r/   little__ctype_be__c                       e Zd ZdZdZdZy)BigEndianStructurez$Structure with big endian byte orderr,   Nr%   r&   r'   __doc__	__slots___swappedbytes_r,   r   r   r3   r3   0   s    2	r   r3   )	metaclassc                       e Zd ZdZdZdZy)BigEndianUnionz Union with big endian byte orderr,   Nr4   r,   r   r   r:   r:   7   s    .	r   r:   big__ctype_le__c                       e Zd ZdZdZdZy)LittleEndianStructurez'Structure with little endian byte orderr,   Nr4   r,   r   r   r>   r>   A   s    5	r   r>   c                       e Zd ZdZdZdZy)LittleEndianUnionz#Union with little endian byte orderr,   Nr4   r,   r   r   r@   r@   H   s    1	r   r@   zInvalid byteorder)sysctypestypeArrayr	   r
   r   r   r*   r   r/   	byteorderr   r>   r3   r@   r:   RuntimeErrorr,   r   r   <module>rG      s    
 5kI"
- 
- A=$y/ @ ;-e ; ==H"M%Y2F 
 *= 
 	]]e"M"	5I 
 NE-@  *
++r   