mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
config: remove ZFS_GLOBAL_ZONE_PAGE_STATE and ZFS_ENUM_* generation
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
committed by
Brian Behlendorf
parent
8d9cb04ea8
commit
ec48dd0976
@@ -28,7 +28,6 @@ endif
|
||||
|
||||
dist_noinst_DATA += \
|
||||
%D%/cstyle.pl \
|
||||
%D%/enum-extract.pl \
|
||||
%D%/update_authors.pl \
|
||||
%D%/zfs2zol-patch.sed \
|
||||
%D%/zol2zfs-patch.sed
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
my $usage = <<EOT;
|
||||
usage: config-enum enum [file ...]
|
||||
|
||||
Returns the elements from an enum declaration.
|
||||
|
||||
"Best effort": we're not building an entire C interpreter here!
|
||||
EOT
|
||||
|
||||
use warnings;
|
||||
use strict;
|
||||
use Getopt::Std;
|
||||
|
||||
my %opts;
|
||||
|
||||
if (!getopts("", \%opts) || @ARGV < 1) {
|
||||
print $usage;
|
||||
exit 2;
|
||||
}
|
||||
|
||||
my $enum = shift;
|
||||
|
||||
my $in_enum = 0;
|
||||
|
||||
while (<>) {
|
||||
# comments
|
||||
s/\/\*.*\*\///;
|
||||
if (m/\/\*/) {
|
||||
while ($_ .= <>) {
|
||||
last if s/\/\*.*\*\///s;
|
||||
}
|
||||
}
|
||||
|
||||
# preprocessor stuff
|
||||
next if /^#/;
|
||||
|
||||
# find our enum
|
||||
$in_enum = 1 if s/^\s*enum\s+${enum}(?:\s|$)//;
|
||||
next unless $in_enum;
|
||||
|
||||
# remove explicit values
|
||||
s/\s*=[^,]+,/,/g;
|
||||
|
||||
# extract each identifier
|
||||
while (m/\b([a-z_][a-z0-9_]*)\b/ig) {
|
||||
print $1, "\n";
|
||||
}
|
||||
|
||||
#
|
||||
# don't exit: there may be multiple versions of the same enum, e.g.
|
||||
# inside different #ifdef blocks. Let's explicitly return all of
|
||||
# them and let external tooling deal with it.
|
||||
#
|
||||
$in_enum = 0 if m/}\s*;/;
|
||||
}
|
||||
|
||||
exit 0;
|
||||
Reference in New Issue
Block a user