???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
fc           @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z e j d ƒ Z e j d ƒ Z e j d ƒ Z e j d ƒ Z e j d ƒ Z	 e e	 g Z
 e j d ƒ Z e j d ƒ Z i  a i  Z y e j d	 j d
 ƒ Z Wn e k
 rÍy e j d j d
 ƒ Z WqÎe k
 rÉyf e  j j d ƒ d k r9e j d j d
 ƒ Z n1 e  j j d ƒ rde j d j d ƒ Z n e ‚ WqÊe k
 rÅd g Z y* e j d e j j d e j d ƒ ƒ WqÆe k
 rÁqÆXqÊXqÎXn Xd „  Z d „  Z i  d „ Z e d k re ƒ  n  d S(   iÿÿÿÿNs+   ^[	 ]*#[	 ]*define[	 ]+([a-zA-Z0-9_]+)[	 ]+sG   ^[	 ]*#[	 ]*define[	 ]+([a-zA-Z0-9_]+)\(([_a-zA-Z][_a-zA-Z0-9]*)\)[	 ]+s"   ^[	 ]*#[	 ]*include[	 ]+<([^>
]+)>s   /\*([^*]+|\*+[^/])*(\*+/)?s   //.*s   '(\\.[^\\]*|[^\\])'s   0x([0-9a-fA-F]+)L?t   includet   ;t   INCLUDEt   beosi    t
   BEINCLUDESt   atheost   C_INCLUDE_PATHt   :s   /usr/includet	   MULTIARCHc          C   sµ  t  j  t j d d ƒ \ }  } x9 |  D]1 \ } } | d k r& t j t j | ƒ ƒ q& q& W| sm d g } n  xA| D]9} | d k r¬ t j j d ƒ t	 t j
 t j ƒ qt t | d ƒ } t j j | ƒ } | j d ƒ } | d k rõ | |  } n  | j ƒ  } | d	 } t | d
 ƒ }	 |	 j d | ƒ i  a xX t D]P }
 | t |
 ƒ  |
 k r8d  t | t |
 ƒ d <| t | t |
 ƒ d <Pq8q8Wt	 | |	 ƒ |	 j ƒ  | j ƒ  qt Wd  S(   Ni   s   i:s   -it   -s   # Generated by h2py from stdin
t   rt   .i    s   .pyt   ws   # Generated by h2py from %s
(   t   getoptt   syst   argvt   ignorest   appendt   ret   compilet   stdoutt   writet   processt   stdint   opent   ost   patht   basenamet   rfindt   uppert   filedictt
   searchdirst   lent   Nonet
   importablet   close(   t   optst   argst   ot   at   filenamet   fpt   outfilet   it   modnamet   outfpt   dir(    (    s*   /usr/lib64/python2.7/Tools/scripts/h2py.pyt   mainD   s8     

c         C   sñ   x  t  D] } | j d |  ƒ }  q Wt j d |  ƒ }  d } d t j d } xž t j |  | ƒ } | sk Pn  | j ƒ  \ } } t |  t	 | j d ƒ Œ  d ƒ } | t j k rß | | 8} |  |  d t
 | ƒ d |  | }  n  | d } qO W|  S(	   Nt    s	   ord('\1')i    i   i   i   t   (t   )(   R   t   subt   p_charR   t   maxintt   p_hext   searcht   spant   longt   slicet   str(   t   bodyt   pt   startt   UMAXt   mt   st   et   val(    (    s*   /usr/lib64/python2.7/Tools/scripts/h2py.pyt   pytifyc   s      "
'c         B   s¡  d } x”|  j  ƒ  } | s Pn  | d } e j | ƒ } | r x> | d d k r~ |  j  ƒ  } | sg Pn  | d } | | } qA W| j d ƒ } | | j ƒ  } e | ƒ } d }	 d | | j ƒ  f }
 y |
 | UWn e j j	 d |
 ƒ q X| j	 |
 ƒ n  e
 j | ƒ } | r–| j d d ƒ \ } } | | j ƒ  } e | ƒ } d | | | f }
 y |
 | UWn e j j	 d |
 ƒ q–X| j	 |
 ƒ n  e j | ƒ } | r	 | j } | d \ } } | | | !} e j | ƒ rø| j	 d	 e | ƒ q™e j | ƒ s™d  e | <d  } x; e D]3 } y e | d
 | ƒ } PWqe k
 rPqXqW| r| j	 d | ƒ e | | | ƒ q–e j j	 d | ƒ q™q	 q	 Wd  S(   Ni    i   iþÿÿÿs   \
s   %s = %s
s   Skipping: %si   s   def %s(%s): return %s
s   from %s import *
t   /s   
# Included from %s
s!   Warning - could not find file %s
(   t   readlinet   p_definet   matcht   groupt   endRD   t   stripR   t   stderrR   t   p_macrot	   p_includet   regsR"   t   has_keyR   R!   R   R   t   IOErrorR   (   R)   R-   t   envt   linenot   lineRH   t   nextlinet   nameR<   t   okt   stmtt   macrot   argRO   R'   t   bR(   t   inclfpR.   (    (    s*   /usr/lib64/python2.7/Tools/scripts/h2py.pyR   w   sr     
 
	
t   __main__(   R   R   R   R   R   RG   RM   RN   t	   p_commentt   p_cpp_commentR   R4   R6   R   R"   t   environt   splitR   t   KeyErrort   platformt   findt
   startswitht   insertR   t   joinR/   RD   R   t   __name__(    (    (    s*   /usr/lib64/python2.7/Tools/scripts/h2py.pyt   <module>   sF   0	
			=