003 File Manager
Current Path:
/usr/src/sys/contrib/openzfs/scripts
usr
/
src
/
sys
/
contrib
/
openzfs
/
scripts
/
📁
..
📄
.gitignore
(10 B)
📄
Makefile.am
(2.46 KB)
📄
commitcheck.sh
(2.87 KB)
📄
common.sh.in
(637 B)
📄
cstyle.pl
(26.17 KB)
📄
dkms.mkconf
(2.93 KB)
📄
dkms.postbuild
(595 B)
📄
enum-extract.pl
(955 B)
📄
kmodtool
(18.41 KB)
📄
make_gitrev.sh
(2 KB)
📄
man-dates.sh
(339 B)
📄
paxcheck.sh
(1.18 KB)
📄
zfs-helpers.sh
(4.46 KB)
📄
zfs-tests.sh
(16.78 KB)
📄
zfs.sh
(5.4 KB)
📄
zfs2zol-patch.sed
(1.14 KB)
📄
zimport.sh
(13.78 KB)
📄
zloop.sh
(8.2 KB)
📄
zol2zfs-patch.sed
(809 B)
Editing: enum-extract.pl
#!/usr/bin/perl -w 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;
Upload File
Create Folder