extern-scan.pl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/usr/bin/env perl
  2. #***************************************************************************
  3. # _ _ ____ _
  4. # Project ___| | | | _ \| |
  5. # / __| | | | |_) | |
  6. # | (__| |_| | _ <| |___
  7. # \___|\___/|_| \_\_____|
  8. #
  9. # Copyright (C) 2010 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
  10. #
  11. # This software is licensed as described in the file COPYING, which
  12. # you should have received as part of this distribution. The terms
  13. # are also available at https://curl.se/docs/copyright.html.
  14. #
  15. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. # copies of the Software, and permit persons to whom the Software is
  17. # furnished to do so, under the terms of the COPYING file.
  18. #
  19. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. # KIND, either express or implied.
  21. #
  22. ###########################################################################
  23. #
  24. #
  25. use strict;
  26. use warnings;
  27. # we may get the dir root pointed out
  28. my $root=$ARGV[0] || ".";
  29. my @incs = (
  30. "$root/include/curl/curl.h",
  31. "$root/include/curl/easy.h",
  32. "$root/include/curl/mprintf.h",
  33. "$root/include/curl/multi.h",
  34. );
  35. my $verbose=0;
  36. my $summary=0;
  37. my $misses=0;
  38. my @syms;
  39. my %doc;
  40. my %rem;
  41. sub scanheader {
  42. my ($f)=@_;
  43. open H, "<$f" || die;
  44. while(<H>) {
  45. if (/^(CURL_EXTERN.*)/) {
  46. my $decl = $1;
  47. $decl =~ s/\r$//;
  48. print "$decl\n";
  49. }
  50. }
  51. close H;
  52. }
  53. foreach my $i (@incs) {
  54. scanheader($i);
  55. }