line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2018, cPanel, LLC. |
2
|
|
|
|
|
|
|
# All rights reserved. |
3
|
|
|
|
|
|
|
# http://cpanel.net |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under the |
6
|
|
|
|
|
|
|
# same terms as Perl itself. See L. |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package Colon::Config; |
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
651968
|
use strict; |
|
4
|
|
|
|
|
24
|
|
|
4
|
|
|
|
|
110
|
|
11
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
211
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# ABSTRACT: XS helper to read a configuration file using ':' as separator |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
BEGIN { |
17
|
|
|
|
|
|
|
|
18
|
4
|
|
|
4
|
|
14
|
our $VERSION = '0.003'; # VERSION: generated by DZP::OurPkgVersion |
19
|
|
|
|
|
|
|
|
20
|
4
|
|
|
|
|
17
|
require XSLoader; |
21
|
4
|
|
|
|
|
2562
|
XSLoader::load(__PACKAGE__); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub read_pp { |
25
|
0
|
|
|
0
|
0
|
0
|
my ( $config ) = @_; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
0
|
return [ map { ( split( m{:\s+}, $_ ) )[ 0, 1 ] } split( m{\n}, $config ) ]; |
|
0
|
|
|
|
|
0
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub read_as_hash { |
31
|
2
|
|
|
2
|
1
|
22968
|
my ( $config ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
|
|
17
|
my $av = Colon::Config::read($config); |
34
|
2
|
50
|
|
|
|
10
|
return unless $av; |
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
|
|
27
|
return { @$av }; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |