
    F\h	                     L   S SK r S SKJrJrJr  \" \5      rS r " S S5      r " S S\\" \5      5      r	 " S S	\\" \5      5      r
\ R                  S
:X  a  Sr\r " S S\\	S9r\r " S S\\
S9rg\ R                  S:X  a  Sr\r " S S\\	S9r\r " S S\\
S9rg\" S5      e)    N)Array	StructureUnionc                    [        U [        5      (       a  [        U [        5      $ [        U [        5      (       a"  [        U R                  5      U R                  -  $ [        U [        [        45      (       a  U $ [        SU -  5      e)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_
issubclassr   r   	TypeError)typs    %/usr/lib/python3.13/ctypes/_endian.pyr   r      sk     sM""sM**#{##SZZ(3<<77#	5)**

ACG
HH    c                   (   ^  \ rS rSrU 4S jrSrU =r$ )_swapped_meta   c                    > US:X  a;  / nU H1  nUS   nUS   nUSS  nUR                  U[        U5      4U-   5        M3     Un[        TU ]  X5        g )N_fields_r         )appendr   super__setattr__)	selfattrnamevaluefieldsdescnamer   rest	__class__s	           r   r   _swapped_meta.__setattr__   sf    z!FAw1gABxt]3%784?@	 
 EH,r    )__name__
__module____qualname____firstlineno__r   __static_attributes____classcell__)r%   s   @r   r   r      s    	- 	-r   r   c                       \ rS rSrSrg)_swapped_struct_meta"   r'   Nr(   r)   r*   r+   r,   r'   r   r   r/   r/   "   s    Dr   r/   c                       \ rS rSrSrg)_swapped_union_meta#   r'   Nr1   r'   r   r   r3   r3   #   s    tr   r3   little__ctype_be__c                        \ rS rSrSrSrSrSrg)BigEndianStructure0   z$Structure with big endian byte orderr'   Nr(   r)   r*   r+   __doc__	__slots___swappedbytes_r,   r'   r   r   r8   r8   0   s    2	r   r8   )	metaclassc                        \ rS rSrSrSrSrSrg)BigEndianUnion7   z Union with big endian byte orderr'   Nr:   r'   r   r   r@   r@   7   s    .	r   r@   big__ctype_le__c                        \ rS rSrSrSrSrSrg)LittleEndianStructureA   z'Structure with little endian byte orderr'   Nr:   r'   r   r   rE   rE   A   s    5	r   rE   c                        \ rS rSrSrSrSrSrg)LittleEndianUnionH   z#Union with little endian byte orderr'   Nr:   r'   r   r   rH   rH   H   s    1	r   rH   zInvalid byteorder)sysctypesr   r   r   typer   r   r   r/   r3   	byteorderr   rE   r8   rH   r@   RuntimeErrorr'   r   r   <module>rO      s    
 * *5kI"
- 
- A=$y/ @ ;-e ; ==H"M%Y2F 
 *= 
 	]]e"M"	5I 
 NE-@  *
++r   