src/main/beos/exports/genexp.pl
author Sam Lantinga <slouken@libsdl.org>
Thu, 11 Apr 2002 14:35:16 +0000
changeset 337 9154ec9ca3d2
parent 0 74212992fb08
child 345 05b97424225f
permissions -rwxr-xr-x
Explicitly specify the SDL API calling convention (C by default)
slouken@0
     1
#!/usr/bin/perl
slouken@0
     2
#
slouken@0
     3
# Program to take a set of header files and generate MWCC export definitions
slouken@0
     4
slouken@0
     5
while ( ($file = shift(@ARGV)) ) {
slouken@0
     6
	if ( ! defined(open(FILE, $file)) ) {
slouken@0
     7
		warn "Couldn't open $file: $!\n";
slouken@0
     8
		next;
slouken@0
     9
	}
slouken@0
    10
	$file =~ s,.*/,,;
slouken@0
    11
	while (<FILE>) {
slouken@337
    12
		if ( /DECLSPEC.*SDLCALL ([^\s\(]+)/ ) {
slouken@0
    13
			print "_$1\n";
slouken@0
    14
		}
slouken@0
    15
	}
slouken@0
    16
	close(FILE);
slouken@0
    17
}
slouken@0
    18
# Special exports not public in the header files