PBProjects/exports/gendef.pl
author Ryan C. Gordon <icculus@icculus.org>
Mon, 14 Mar 2005 11:49:30 +0000
changeset 691 71d9affe0d8a
parent 518 678bd642c6b5
permissions -rw-r--r--
All memory management now goes through allocation hooks instead of directly to C runtime malloc/realloc/free...

#!/usr/bin/perl
#
# Program to take a set of header files and generate DLL export definitions

while ( ($file = shift(@ARGV)) ) {
	if ( ! defined(open(FILE, $file)) ) {
		warn "Couldn't open $file: $!\n";
		next;
	}
	$printed_header = 0;
	$file =~ s,.*/,,;
	while (<FILE>) {
		if ( /^__EXPORT__.*\s\**([^\s\(]+)\(/ ) {
			print "\t_$1\n";
		} elsif ( /^__EXPORT__.*\s\**([^\s\(]+)$/ ) {
			print "\t_$1\n";
		}
	}
	close(FILE);
}