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 | # Verify that curl_version_info.3 documents all the CURL_VERSION_ bits |
| 27 | # from the header. |
| 28 | # |
| 29 | |
| 30 | use strict; |
| 31 | use warnings; |
| 32 | |
| 33 | my $manpage=$ARGV[0]; |
| 34 | my $header=$ARGV[1]; |
| 35 | my %manversion; |
| 36 | my %headerversion; |
| 37 | my $error; |
| 38 | |
| 39 | open(M, "<$manpage"); |
| 40 | while(<M>) { |
| 41 | if($_ =~ /^.ip (CURL_VERSION_[A-Z0-9_]+)/i) { |
| 42 | $manversion{$1}++; |
| 43 | } |
| 44 | } |
| 45 | close(M); |
| 46 | |
| 47 | open(H, "<$header"); |
| 48 | while(<H>) { |
| 49 | if($_ =~ /^\#define (CURL_VERSION_[A-Z0-9_]+)/i) { |
| 50 | $headerversion{$1}++; |
| 51 | } |
| 52 | } |
| 53 | close(H); |
| 54 | |
| 55 | for my $h (keys %headerversion) { |
| 56 | if(!$manversion{$h}) { |
| 57 | print STDERR "$manpage: missing $h\n"; |
| 58 | $error++; |
| 59 | } |
| 60 | } |
| 61 | for my $h (keys %manversion) { |
| 62 | if(!$headerversion{$h}) { |
| 63 | print STDERR "$manpage: $h is not in the header!\n"; |
| 64 | $error++; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | exit $error; |