use warnings;
use Carp qw(croak);
+use Const::Fast qw(const);
use Encode qw(encode);
use File::Basename qw(basename);
-use JSON;
+use JSON::MaybeXS qw(JSON);
use Perl6::Slurp qw(slurp);
-use Readonly;
##############################################################################
# Global variables
##############################################################################
# The header on the generated source file.
-Readonly my $HEADER => <<'END_HEADER';
+const my $HEADER => <<'END_HEADER';
/*
* Automatically generated -- do not edit!
*
END_HEADER
# The list of attributes, in order, whose values go into the C struct.
-Readonly my @ATTRIBUTES => qw(
- name principal password code error skip_for_system_cracklib
+const my @ATTRIBUTES => qw(
+ name principal password code error skip_for_system_cracklib
);
# A hash of attributes that should be put in the C struct as they literally
# appear in the JSON, rather than as strings. (In other words, attributes
# that are numbers, booleans, or C constants.) Only the keys are of interest.
-Readonly my %IS_LITERAL_ATTRIBUTE => (
- code => 1,
- skip_for_system_cracklib => 1
+const my %IS_LITERAL_ATTRIBUTE => (
+ code => 1,
+ skip_for_system_cracklib => 1,
);
##############################################################################
=head1 COPYRIGHT AND LICENSE
-Copyright 2020 Russ Allbery <eagle@eyrie.org>
+Copyright 2020, 2023 Russ Allbery <eagle@eyrie.org>
Copyright 2013 The Board of Trustees of the Leland Stanford Junior
University