PBProjects/exports/gendef.pl
author Ryan C. Gordon <icculus@icculus.org>
Mon, 23 Mar 2009 01:43:05 -0400
branchstable-1.0
changeset 966 816a83f04a27
parent 518 678bd642c6b5
permissions -rw-r--r--
Updated version to 1.0.2 in configure.in ...

#!/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);
}