version: add a feature names array to curl_version_info_data

Field feature_names contains a null-terminated sorted array of feature
names. Bitmask field features is deprecated.

Documentation is updated. Test 1177 and tests/version-scan.pl updated to
match new documentation format and extended to check feature names too.

Closes #9583
This commit is contained in:
Patrick Monnerat 2022-11-09 00:27:32 +01:00 committed by Daniel Stenberg
parent 00ea0aaf46
commit e780aae77a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 307 additions and 144 deletions

View file

@ -32,15 +32,21 @@ use warnings;
my $manpage=$ARGV[0];
my $header=$ARGV[1];
my $source=$ARGV[2];
my %manversion;
my %headerversion;
my $error;
my %manname;
my %sourcename;
my $error=0;
open(M, "<$manpage");
while(<M>) {
if($_ =~ /^.ip (CURL_VERSION_[A-Z0-9_]+)/i) {
if($_ =~ / mask bit: (CURL_VERSION_[A-Z0-9_]+)/i) {
$manversion{$1}++;
}
if($_ =~ /^\.ip """([^"]+)"""/i) {
$manname{$1}++;
}
}
close(M);
@ -52,6 +58,14 @@ while(<H>) {
}
close(H);
open(S, "<$source");
while(<S>) {
if($_ =~ /FEATURE\("([^"]*)"/) {
$sourcename{$1}++;
}
}
close(S);
for my $h (keys %headerversion) {
if(!$manversion{$h}) {
print STDERR "$manpage: missing $h\n";
@ -64,5 +78,17 @@ for my $h (keys %manversion) {
$error++;
}
}
for my $n (keys %sourcename) {
if(!$manname{$n}) {
print STDERR "$manpage: missing feature name $n\n";
$error++;
}
}
for my $n (keys %manname) {
if(!$sourcename{$n}) {
print STDERR "$manpage: $n is not in the source!\n";
$error++;
}
}
exit $error;