ó
şmNc           @   sÃ   d  d l  Z  d  d l Te e d ƒ Z d „  Z d e e ƒ f d „  ƒ  YZ e  j d k r d Z	 e Z
 d	 e f d
 „  ƒ  YZ n@ e  j d k r³ d Z	 e Z d e f d „  ƒ  YZ
 n e d ƒ ‚ d S(   iÿÿÿÿN(   t   *i   c         C   s_   y t  |  t ƒ SWnG t k
 rZ t |  ƒ t k rG t |  j ƒ |  j St d |  ƒ ‚ n Xd S(   så   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
    only arrays are supported.
    s+   This type does not support other endian: %sN(	   t   getattrt   _OTHER_ENDIANt   AttributeErrort   typet   _array_typet   _other_endiant   _type_t   _length_t	   TypeError(   t   typ(    (    s#   C:\RCS\Python\lib\ctypes\_endian.pyR   	   s    t   _swapped_metac           B   s   e  Z d  „  Z RS(   c         C   s„   | d k rg g  } xI | D]A } | d } | d } | d } | j  | t | ƒ f | ƒ q W| } n  t t |  ƒ j | | ƒ d  S(   Nt   _fields_i    i   i   (   t   appendR   t   superR   t   __setattr__(   t   selft   attrnamet   valuet   fieldst   desct   nameR
   t   rest(    (    s#   C:\RCS\Python\lib\ctypes\_endian.pyR      s    


!	(   t   __name__t
   __module__R   (    (    (    s#   C:\RCS\Python\lib\ctypes\_endian.pyR      s   t   littlet   __ctype_be__t   BigEndianStructurec           B   s   e  Z d  Z e Z d Z RS(   s$   Structure with big endian byte orderN(   R   R   t   __doc__R   t   __metaclass__t   Nonet   _swappedbytes_(    (    (    s#   C:\RCS\Python\lib\ctypes\_endian.pyR   -   s   t   bigt   __ctype_le__t   LittleEndianStructurec           B   s   e  Z d  Z e Z d Z RS(   s'   Structure with little endian byte orderN(   R   R   R   R   R   R   R   (    (    (    s#   C:\RCS\Python\lib\ctypes\_endian.pyR"   6   s   s   Invalid byteorder(   t   syst   ctypesR   t   c_intR   R   t	   StructureR   t	   byteorderR   R"   R   t   RuntimeError(    (    (    s#   C:\RCS\Python\lib\ctypes\_endian.pyt   <module>   s   
	