bg.ddlZddlZddlZdZdZdeejddzZddgZdezZ ej d ezej Z ej d ezej Z d Zddd ezgd fdZdZejfdZedkr]e\ZZeejZn eedZeeegzZeedZee\ZZeeee edSdS)NaThis 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 z0.1az%d%dnmz-CszrLIBRARY python%s.dll ;CODE PRELOAD MOVEABLE DISCARDABLE ;DATA PRELOAD SINGLE EXPORTS z^(.*) in python%s\.dllz^_imp__(.*) in python%s\.dllcttjdkrtjddddkr7tjddddkrtjdd\}}n tjddddkr6tjddddkrtjdd\}}ntdtd nttjdkrntjddddkrtjd}d tz}n?tjddddkrd}tjd}n d tz}d}||fS) zBParses the command-line arguments. libfile, deffile = parse_cmd()Nz.librz.defz4I'm assuming that your first argument is the libraryzand the second is the DEF file. python%s.lib)lensysargvprintpy_ver)libfiledeffiles j/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib64/python3.11/site-packages/numpy/distutils/lib2def.py parse_cmdr&sS 38}} 8A;rss v % %#(1+bcc*:f*D*D"x| GWW Xa[  ' 'CHQK,<,F,F"x| GWW H I I I 3 4 4 4 4 SX!   8A;rss v % %hqkG$v-GG Xa[  ' 'GhqkG 6) G r Tctj||tjtjd}|\}}|jdkr)t dd|d|d|S)zUReturns the output of nm_cmd via a pipe. nm_output = getnm(nm_cmd = 'nm -Cs py_lib')T)shellstdoutstderrtextrzfailed to run " z": "") subprocessPopenPIPE communicate returncode RuntimeErrorjoin)nm_cmdrp nm_outputnm_errs rgetnmr&>s uZ_ *d < < `se33-(22 d]F..(X--JJvr__main__wF)r)rer r__doc__ __version__tuple version_infor DEFAULT_NM DEF_HEADERcompile MULTILINEr.r,rr&r6rr>__name__rropenstrr"r$r5r3rrrNs    %%(!,-- -E]     "*.7 F F "*4v=r| L L0~67t    ,-0J     z y{{GW*$w$$ 33w<<. (FfE***I8I&&LE5JueZ11111r