1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-04-23 11:58:50 +02:00
David Steele fe4ba455ed Move configuration definition to src/build/config/config.yaml.
Moving to YAML allows the configuration data to be read by C programs.

Also go back to using YAML::XS since it is the only implementation that has proper boolean support.
2021-03-08 16:01:05 -05:00

53 lines
2.1 KiB
Perl

####################################################################################################################################
# Error Definition Data
####################################################################################################################################
package pgBackRestBuild::Error::Data;
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
our @EXPORT = qw();
use Storable qw(dclone);
####################################################################################################################################
# Error min and max values
####################################################################################################################################
use constant ERRDEF_MIN => 25;
push @EXPORT, qw(ERRDEF_MIN);
use constant ERRDEF_MAX => 125;
push @EXPORT, qw(ERRDEF_MAX);
####################################################################################################################################
# Error definition data
####################################################################################################################################
my $rhErrorDefine;
####################################################################################################################################
# Load error definition from YAML
####################################################################################################################################
sub errorDefineLoad
{
my $strErrorYaml = shift;
require YAML::XS;
YAML::XS->import(qw(Load));
$rhErrorDefine = Load($strErrorYaml);
}
push @EXPORT, qw(errorDefineLoad);
####################################################################################################################################
# Get error definition
####################################################################################################################################
sub errorDefine
{
return dclone($rhErrorDefine);
}
push @EXPORT, qw(errorDefine);
1;