3 ^@sddlZddlTeeZddZGdddeeZejdkr\dZ eZ Gd d d eed Z n0ejd krd Z eZ Gdddeed Z ne ddS)N)*cCsLt|trt|tSt|tr.t|j|jSt|t r<|St d|dS)Nz+This type does not support other endian: %s) hasattr _OTHER_ENDIANgetattr isinstance _array_type _other_endianZ_type_Z_length_ issubclass Structure TypeError)typr &/usr/lib64/python3.6/ctypes/_endian.pyrs    rcseZdZfddZZS) _swapped_metacsb|dkrPg}x>|D]6}|d}|d}|dd}|j|t|f|qW|}tj||dS)NZ_fields_r)appendrsuper __setattr__)selfZattrnamevalueZfieldsZdescnamer rest) __class__r rrs  z_swapped_meta.__setattr__)__name__ __module__ __qualname__r __classcell__r r )rrrsrlittleZ __ctype_be__c@seZdZfZdZdS)BigEndianStructureN)rrr __slots___swappedbytes_r r r rr.sr) metaclassZbigZ __ctype_le__c@seZdZfZdZdS)LittleEndianStructureN)rrrr r!r r r rr#7sr#zInvalid byteorder) sysZctypestypeZArrayrrr r byteorderrr#r RuntimeErrorr r r rs