ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ ]c@`s}ddlmZmZmZddlZddlZddlZddlZdZdZ de ej d Z dZ de Zejd e ejZejd e ejZd Zd d de gdZdZejdZedkrye\ZZedkrejZneedZee eegZeeZee\Z Z!ee e!eendS(i(tdivisiontabsolute_importtprint_functionNsThis module generates a DEF file from the symbols in an MSVC-compiled DLL import library. It correctly discriminates between data and functions. The data is collected from the output of the program nm(1). Usage: python lib2def.py [libname.lib] [output.def] or python lib2def.py [libname.lib] > output.def libname.lib defaults to python.lib and output.def defaults to stdout Author: Robert Kern Last Update: April 30, 1999 s0.1as%d%disnm -CssrLIBRARY python%s.dll ;CODE PRELOAD MOVEABLE DISCARDABLE ;DATA PRELOAD SINGLE EXPORTS s^(.*) in python%s\.dlls^_imp__(.*) in python%s\.dllcC`sDttjdkrtjdddkrYtjdddkrYtjd\}}q:tjdddkrtjdddkrtjd\}}q:tdtdnttjdkr*tjdddkrtjd}d t}q:tjdddkr:d }tjd}q:nd t}d }||fS( sBParses the command-line arguments. libfile, deffile = parse_cmd()iiis.libis.defs4I'm assuming that your first argument is the librarysand the second is the DEF file.s python%s.libN(tlentsystargvtprinttpy_vertNone(tlibfiletdeffile((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/lib2def.pyt parse_cmd)s"..     tnms-Css python%s.libcC`sDtj|dtdtjdt}|jj}|jj|S(sVReturns the output of nm_cmd via a pipe. nm_output = getnam(nm_cmd = 'nm -Cs py_lib')tshelltstdouttuniversal_newlines(t subprocesstPopentTruetPIPERtreadtclose(tnm_cmdtft nm_output((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/lib2def.pytgetnmAs$ cC`stj|}tj|}g}xZ|D]R}||kr+|d dksm|d dksm|d dkr+|j|q+q+Wg}xJ|D]B}||kr|d dks|d dkr|j|qqW|j|j||fS(sReturns a tuple of lists: dlist for the list of data symbols and flist for the list of function symbols. dlist, flist = parse_nm(nm_output)itPyit_Pyitinit(tDATA_REtfindalltFUNC_REtappendtsort(Rtdatatfunctflisttsymtdlist((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/lib2def.pytparse_nmJs < ,  cC`sYx|D]}|d|}qW|d}x|D]}|d|}q0W|j|dS(soOutputs the final DEF file to a file defaulting to stdout. output_def(dlist, flist, header, file = sys.stdout)s %s DATA s s %s N(twrite(R&R$theadertfiletdata_symtfunc_sym((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/lib2def.pyt output_def`s    t__main__tw("t __future__RRRtreRtosRt__doc__t __version__ttuplet version_infoRt DEFAULT_NMt DEF_HEADERtcompilet MULTILINERRR RR'RR-t__name__R R RtopentstrRRR&R$(((sJ/opt/alt/python27/lib64/python2.7/site-packages/numpy/distutils/lib2def.pyts0