#!/usr/bin/env perl1#***************************************************************************2# _ _ ____ _3# Project ___| | | | _ \| |4# / __| | | | |_) | |5# | (__| |_| | _ <| |___6# \___|\___/|_| \_\_____|7#8# Copyright (C) Daniel Stenberg, <[email protected]>, et al.9#10# This software is licensed as described in the file COPYING, which11# you should have received as part of this distribution. The terms12# are also available at https://curl.se/docs/copyright.html.13#14# You may opt to use, copy, modify, merge, publish, distribute and/or sell15# copies of the Software, and permit persons to whom the Software is16# furnished to do so, under the terms of the COPYING file.17#18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY19# KIND, either express or implied.20#21# SPDX-License-Identifier: curl22#23###########################################################################2425use strict;26use warnings;2728# we may get the dir root pointed out29my $root = $ARGV[0] || ".";3031my %error; # from the include file32my %docs; # from libcurl-errors.33334sub getdocserrors {35open(my $f, "<", "$root/docs/libcurl/libcurl-errors.md");36while(<$f>) {37if($_ =~ /^## (CURL[EM]_[^ ]*)/) {38my ($symbol) = ($1);39if($symbol =~ /OBSOLETE/) {40;41}42else {43$docs{$symbol}=1;44}45}46}47close($f);48}4950sub getincludeerrors {51open(my $f, "<", "$root/docs/libcurl/symbols-in-versions");52while(<$f>) {53if($_ =~ /^(CURL[EM]_[^ \t]*)[ \t]*([0-9.]+)[ \t]*(.*)/) {54my ($symbol, $added, $rest) = ($1,$2,$3);55if($rest =~ /^([0-9.]+)/) {56# removed!57}58else {59$error{$symbol}=$added;60}61}62}63close($f);64}6566getincludeerrors();67getdocserrors();6869for(sort keys %error) {70if($error{$_} && !$docs{$_}) {71print "$_ is not in libcurl-errors.md\n";72}73}7475for(sort keys %docs) {76if($docs{$_} && !$error{$_}) {77print "$_ is not in symbols-in-versions\n";78}79}808182