#!/bin/sh tlow(){ echo $1|tr A-Z a-z } if [ x"$1" = x"" ];then echo "shell script to generate .def files from .LIB files $0 filename ..." exit 0 else echo LIBRARY `basename $1 .lib` echo EXPORTS echo fakefunc$RANDOM nm --extern-only $1|egrep '^........ [TR]' \ |fgrep -v '$AA'\ |fgrep -v 'C@_0'\ |fgrep -v '@@' \ |sort \ |sed -e 's/[^_]*_//' -e 's/[^?]*?//' fi # T= .text section R= readonly .data section (exported variables) # $AA C@_0 @@ exported structure/internal function definitions