gendef.pl 430 B

1234567891011121314151617181920
  1. #!/usr/bin/perl
  2. #
  3. # Program to take a set of header files and generate DLL export definitions
  4. while ( ($file = shift(@ARGV)) ) {
  5. if ( ! defined(open(FILE, $file)) ) {
  6. warn "Couldn't open $file: $!\n";
  7. next;
  8. }
  9. $printed_header = 0;
  10. $file =~ s,.*/,,;
  11. while (<FILE>) {
  12. if ( /^__EXPORT__.*\s\**([^\s\(]+)\(/ ) {
  13. print "\t_$1\n";
  14. } elsif ( /^__EXPORT__.*\s\**([^\s\(]+)$/ ) {
  15. print "\t_$1\n";
  16. }
  17. }
  18. close(FILE);
  19. }