• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env perl
2#***************************************************************************
3#                                  _   _ ____  _
4#  Project                     ___| | | |  _ \| |
5#                             / __| | | | |_) | |
6#                            | (__| |_| |  _ <| |___
7#                             \___|\___/|_| \_\_____|
8#
9# Copyright (C) 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
28use strict;
29use warnings;
30
31# we may get the dir root pointed out
32my $root=$ARGV[0] || ".";
33
34my @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
44my $verbose=0;
45my $summary=0;
46my $misses=0;
47
48my @syms;
49my %doc;
50my %rem;
51
52sub scanheader {
53    my ($f)=@_;
54    open H, "<$f" || die;
55    my $first = "";
56    while(<H>) {
57        s/CURL_DEPRECATED\(.*"\)//;
58        s/  */ /g;
59        if (/^(^CURL_EXTERN .*)\(/) {
60            my $decl = $1;
61            $decl =~ s/\r$//;
62            print "$decl\n";
63        }
64        elsif (/^(^CURL_EXTERN .*)/) {
65            # handle two-line declarations
66            my $decl = $1;
67            $decl =~ s/\r$//;
68            $first = $decl;
69        }
70        elsif($first) {
71            if (/^ *(.*)\(/) {
72                my $decl = $1;
73                $decl =~ s/\r$//;
74                $first .= $decl;
75                print "$first\n";
76            }
77            $first = "";
78        }
79    }
80    close H;
81}
82
83foreach my $i (@incs) {
84    scanheader($i);
85}
86