Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
878 B

  1. #!perl -w
  2. use strict;
  3. use warnings;
  4. use IO::File;
  5. ScanFile(shift @ARGV);
  6. sub ScanFile
  7. {
  8. my $filename = shift || die "Must specify filename\n";
  9. my $fh = new IO::File;
  10. $fh->open("<$filename") ||
  11. die ERROR_CANNOT_OPEN_FOR_INPUT($filename)."\n";
  12. my @lines = $fh->getlines();
  13. my @funcs;
  14. map {
  15. push(@funcs, $1) if /([A-Za-z0-9_]+)\s*\(\s*$/;
  16. } @lines;
  17. map {
  18. push(@funcs, $1) if /([A-Za-z0-9_]+)\s*\(\s*\)\s*;\s*$/;
  19. } @lines;
  20. map { print "$_\n"; } @funcs;
  21. }
  22. ###############################################################################
  23. sub ERROR_CANNOT_OPEN_FOR_INPUT
  24. {
  25. my $filename = shift || die;
  26. return "Could not open file for input: \"$filename\"";
  27. }
  28. sub ERROR_CANNOT_OPEN_FOR_OUTPUT
  29. {
  30. my $filename = shift || die;
  31. return "Could not open file for output: \"$filename\"";
  32. }