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 ...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
518
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
#!/usr/bin/perl
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
#
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
# Program to take a set of header files and generate DLL export definitions
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
while ( ($file = shift(@ARGV)) ) {
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
	if ( ! defined(open(FILE, $file)) ) {
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
		warn "Couldn't open $file: $!\n";
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
		next;
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
	}
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
	$printed_header = 0;
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
	$file =~ s,.*/,,;
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
	while (<FILE>) {
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
		if ( /^__EXPORT__.*\s\**([^\s\(]+)\(/ ) {
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
			print "\t_$1\n";
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
		} elsif ( /^__EXPORT__.*\s\**([^\s\(]+)$/ ) {
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
			print "\t_$1\n";
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    17
		}
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
	}
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
	close(FILE);
678bd642c6b5 Added Apple Project Builder support files to CVS.
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
}