???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ó
fc           @   s¬   d  Z  d d l Z d d l Z d e j d  d Z d e j d e j d d	 Z d
 Z e d d „ Z d „  Z d Z	 d Z
 e
 d „ Z d „  Z e d k r¨ e ƒ  n  d S(   sE  nm2def.py

Helpers to extract symbols from Unix libs and auto-generate
Windows definition files from them. Depends on nm(1). Tested
on Linux and Solaris only (-p option to nm is for Solaris only).

By Marc-Andre Lemburg, Aug 1998.

Additional notes: the output of nm is supposed to look like this:

acceler.o:
000001fd T PyGrammar_AddAccelerators
         U PyGrammar_FindDFA
00000237 T PyGrammar_RemoveAccelerators
         U _IO_stderr_
         U exit
         U fprintf
         U free
         U malloc
         U printf

grammar1.o:
00000000 T PyGrammar_FindDFA
00000034 T PyGrammar_LabelRepr
         U _PyParser_TokenNames
         U abort
         U printf
         U sprintf

...

Even if this isn't the default output of your nm, there is generally an
option to produce this format (since it is the original v7 Unix format).

iÿÿÿÿNt	   libpythoni   s   .at   Pythoni    i   s   .dlls   nm -p -g %st   Tt   Ct   Dc   
      C   sÌ   t  j t |  ƒ j ƒ  } g  | D] } | j ƒ  ^ q  } i  } x‡ | D] } t | ƒ d k sE d | k ro qE n  | j ƒ  } t | ƒ d k r“ qE n  | \ } } }	 | | k r´ qE n  | | f | |	 <qE W| S(   Ni    t   :i   (   t   ost   popent   NMt	   readlinest   stript   lent   split(
   t   libt   typest   linest   st   symbolst   linet   itemst   addresst   typet   name(    (    s,   /usr/lib64/python2.7/Tools/scripts/nm2def.pyR   +   s    c         C   sŸ   g  } g  } xQ |  j  ƒ  D]C \ } \ } } | d k rK | j d | ƒ q | j d | ƒ q W| j ƒ  | j d ƒ | j ƒ  d j | ƒ d d j | ƒ S(   NR   R   s   	t    s    DATA
s   
(   R   R   (   R   t   appendt   sortt   join(   R   t   datat   codeR   t   addrR   (    (    s,   /usr/lib64/python2.7/Tools/scripts/nm2def.pyt   export_list<   s    

s   EXPORTS
%s
c         C   sT   xM |  j  ƒ  D]? } | d  d k sL | d  d k r6 q | | k r |  | =q q Wd  S(   Ni   t   Pyi   t   _Py(   t   keys(   R   t   specialsR   (    (    s,   /usr/lib64/python2.7/Tools/scripts/nm2def.pyt   filter_PythonU   s
     c          C   sJ   t  t ƒ }  t |  ƒ t |  ƒ } t j } | j t | ƒ | j ƒ  d  S(   N(	   R   t	   PYTHONLIBR#   R   t   syst   stdoutt   writet   DEF_TEMPLATEt   close(   R   t   exportst   f(    (    s,   /usr/lib64/python2.7/Tools/scripts/nm2def.pyt   main]   s    
	t   __main__(   R   R   R   (    (   t   __doc__R   R%   t   versionR$   t   PC_PYTHONLIBR   R   R   R(   t   SPECIALSR#   R,   t   __name__(    (    (    s,   /usr/lib64/python2.7/Tools/scripts/nm2def.pyt   <module>$   s    			