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