xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | #!/usr/bin/env perl |
| 2 | #*************************************************************************** |
| 3 | # _ _ ____ _ |
| 4 | # Project ___| | | | _ \| | |
| 5 | # / __| | | | |_) | | |
| 6 | # | (__| |_| | _ <| |___ |
| 7 | # \___|\___/|_| \_\_____| |
| 8 | # |
| 9 | # Copyright (C) 2010 - 2022, 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 | # SPDX-License-Identifier: curl |
| 23 | # |
| 24 | ########################################################################### |
| 25 | # |
| 26 | # |
| 27 | |
| 28 | use strict; |
| 29 | use warnings; |
| 30 | |
| 31 | # we may get the dir root pointed out |
| 32 | my $root=$ARGV[0] || "."; |
| 33 | |
| 34 | my @incs = ( |
| 35 | "$root/include/curl/curl.h", |
| 36 | "$root/include/curl/easy.h", |
| 37 | "$root/include/curl/mprintf.h", |
| 38 | "$root/include/curl/multi.h", |
| 39 | "$root/include/curl/urlapi.h", |
| 40 | "$root/include/curl/options.h", |
| 41 | "$root/include/curl/header.h", |
| 42 | ); |
| 43 | |
| 44 | my $verbose=0; |
| 45 | my $summary=0; |
| 46 | my $misses=0; |
| 47 | |
| 48 | my @syms; |
| 49 | my %doc; |
| 50 | my %rem; |
| 51 | |
| 52 | sub scanheader { |
| 53 | my ($f)=@_; |
| 54 | open H, "<$f" || die; |
| 55 | my $first = ""; |
| 56 | while(<H>) { |
| 57 | if (/^(^CURL_EXTERN .*)\(/) { |
| 58 | my $decl = $1; |
| 59 | $decl =~ s/\r$//; |
| 60 | print "$decl\n"; |
| 61 | } |
| 62 | elsif (/^(^CURL_EXTERN .*)/) { |
| 63 | # handle two-line declarations |
| 64 | my $decl = $1; |
| 65 | $decl =~ s/\r$//; |
| 66 | $first = $decl; |
| 67 | } |
| 68 | elsif($first) { |
| 69 | if (/^(.*)\(/) { |
| 70 | my $decl = $1; |
| 71 | $decl =~ s/\r$//; |
| 72 | $first .= $decl; |
| 73 | print "$first\n"; |
| 74 | } |
| 75 | $first = ""; |
| 76 | } |
| 77 | } |
| 78 | close H; |
| 79 | } |
| 80 | |
| 81 | foreach my $i (@incs) { |
| 82 | scanheader($i); |
| 83 | } |