exports/DLL's
11-Jul-94 22:14:01
Sb: #30599-exports/DLL's
Fm: Jeffrey Trent 76360,1425
To: David O. Hicks 76702,1002
Mike,
Okay, here is the AWK script. It takes a map file for an argument and outputs
the exports section (with comments) of the DEF file EXPORTS section.
I don't know how to Upload to a library using TapCIS so this will have to do
unfortunately…
———- # # EXPORT.AWK # # # # command line arguements: #
# fp=1 -> filter private
functions of a class # fp=2 ->
filter private and protected functions of a class # #
fr="<regular expression>" -> filter based on regular
expression # # fd=1 ->
filter global data objects # fd=2 ->
filter global data objects except CRuntimeClass information for C++ objects # #
fo=1 -> filter 'new' and 'delete' operators # #
fv=1 -> filter virtual function table entries #
#
$1 == "Address" && $2 == "Publics" && $4 == "Name" {
print "; EXPORT.AWK output using directives:\n;\t\t" "fp=" fp ";\tfr='"
fr "';\tfd=" fd ";\tfo=" fo ";\tfv=" fv "\n;\n"
Inside = 1
getline }
Inside == 1 && $1 ~ /[0-9]+:[0-9]+/ && $2 != "Imp" && $2 ~ /\?/ {
#print alias first
funcDescriptor = "\t\t" $2
getline
funcAlias = LTrim($0)
if ( PassedFilterTest( funcAlias ) )
print ";\t" funcAlias "\n" funcDescriptor "\n" }
Inside == 1 && $1 == "Address" {
Inside = 0 }
# – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
function LTrim( str ) {
sub(/^[ \t]+/, "", str)
return str }
function PassedFilterTest( str ) { # fp=1
-> filter private functions of a class
if ( fp == 1 || fp == 2 )
if ( str ~ /^([thunk]:)*private:/ )
return 0
# fp=2 -> filter private
and protected functions of a class
if ( fp == 2 )
if ( str ~ /^([thunk]:)*protected:/ )
return 0
# fd=1 -> filter global
data objects
if ( fd == 1 )
if ( str !~ /\(.*\)/ )
return 0
# fd=2 -> filter global
data objects except CRuntimeClass information for C++ objects
if ( fd == 2 )
if ( str !~ /\(.*\)/ && str ~! /CRuntimeClass.*::class/ )
return 0
# fr="<regular expression>" ->
filter based on regular expression
if ( fr != "" )
if ( str ~ ek )
return 0
# fo=1 -> filter 'new' and
'delete' operators
if ( fo == 1 )
if ( str ~ /operator new/ || str ~ /operator delete/ )
return 0
# fv=1 -> filter virtual
function table entries
if ( fv == 1 )
if ( str ~ /\`vftable\'/ )
return 0
return 1 } w