| 1 | package PkgConfig::LibPkgConf::Util; | ||
| 2 | |||
| 3 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 4 | ▶ | use base qw( Exporter ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 4 | ▶ | use PkgConfig::LibPkgConf::XS; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 4 | our $VERSION = '0.11'; | |
| 9 | 4 | our @EXPORT_OK = qw( argv_split compare_version path_sep path_relocate ); | |
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | PkgConfig::LibPkgConf::Util - Non OO functions for PkgConfig::LibPkgConf | ||
| 14 | |||
| 15 | =head1 SYNOPSIS | ||
| 16 | |||
| 17 | use PkgConfig::LibPkgConf::Util qw( argv_split compare_version ); | ||
| 18 | |||
| 19 | my @args = argv_split('-L/foo -lfoo'); # ('-L/foo', '-lfoo'); | ||
| 20 | my $cmp = compare_version('1.2.3','1.2.4'); | ||
| 21 | |||
| 22 | =head1 DESCRIPTION | ||
| 23 | |||
| 24 | This module provides some useful utility functions that come along with | ||
| 25 | C<libpkgconf>, but are not object oriented and thus do not get their own | ||
| 26 | class. | ||
| 27 | |||
| 28 | =head1 FUNCTIONS | ||
| 29 | |||
| 30 | =head2 argv_split | ||
| 31 | |||
| 32 | my @argv = argv_split $args; | ||
| 33 | |||
| 34 | Splits a string into an argument list. | ||
| 35 | |||
| 36 | =head2 compare_version | ||
| 37 | |||
| 38 | my $cmp = compare_version($version1, $version2); | ||
| 39 | |||
| 40 | Compare versions using RPM version comparison rules as described in the LSB. | ||
| 41 | Returns -1 if the first version is greater, 0 if both versions are equal, | ||
| 42 | 1 if the second version is greater. | ||
| 43 | |||
| 44 | =head2 path_relocate | ||
| 45 | |||
| 46 | my $path = path_relocate($path); | ||
| 47 | |||
| 48 | Relocates a path, possibly calling realpath() or cygwin_conv_path() on it. | ||
| 49 | |||
| 50 | =head2 path_sep | ||
| 51 | |||
| 52 | my $sep = path_sep; | ||
| 53 | |||
| 54 | Returns the path separator as understood by C<pkgconf>. This is usually | ||
| 55 | C<:> on UNIX and C<;> on Windows. | ||
| 56 | |||
| 57 | =head1 SUPPORT | ||
| 58 | |||
| 59 | IRC #native on irc.perl.org | ||
| 60 | |||
| 61 | Project GitHub tracker: | ||
| 62 | |||
| 63 | L<https://github.com/plicease/PkgConfig-LibPkgConf/issues> | ||
| 64 | |||
| 65 | If you want to contribute, please open a pull request on GitHub: | ||
| 66 | |||
| 67 | L<https://github.com/plicease/PkgConfig-LibPkgConf/pulls> | ||
| 68 | |||
| 69 | =head1 SEE ALSO | ||
| 70 | |||
| 71 | For additional related modules, see L<PkgConfig::LibPkgConf> | ||
| 72 | |||
| 73 | =head1 AUTHOR | ||
| 74 | |||
| 75 | Graham Ollis | ||
| 76 | |||
| 77 | For additional contributors see L<PkgConfig::LibPkgConf> | ||
| 78 | |||
| 79 | =head1 COPYRIGHT AND LICENSE | ||
| 80 | |||
| 81 | This software is copyright (c) 2016 Graham Ollis. | ||
| 82 | |||
| 83 | This is free software; you may redistribute it and/or modify it under | ||
| 84 | the same terms as the Perl 5 programming language system itself. | ||
| 85 | |||
| 86 | =cut | ||
| 87 | |||
| 88 | 4 | 1; | |