1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
package Term::Choose::LineFold::XS;
use strict;
use warnings;
use 5.16.0;
our $VERSION = '0.004';
use Exporter 'import';
our @EXPORT_OK = qw( print_columns );
require XSLoader;
XSLoader::load( 'Term::Choose::LineFold::XS', $VERSION );
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Term::Choose::LineFold::XS - XS acceleration for Term-Choose-LineFold
=head1 VERSION
Version 0.004
=cut
=head1 DESCRIPTION
I<Width> in this context refers to the number of occupied columns of a character string on a terminal with a monospaced
font.
By default ambiguous width characters are treated as half width. If the environment variable
C<TC_AMBIGUOUS_WIDTH_IS_WIDE> is set to a true value, ambiguous width characters are treated as full width.
=head2 Perl version
Requires Perl version 5.16.0 or greater.
=head1 EXPORT
Nothing by default.
use Term::Choose::LineFold::XS qw( print_columns );
=head1 FUNCTIONS
=head2 print_columns
Get the number of occupied columns of a character string on a terminal.
The string passed to this function is a decoded string, free of control characters, non-characters, and surrogates.
$print_width = print_columns( $string );
=head1 AUTHOR
Matthäus Kiem <cuer2s@gmail.com>
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2025 Matthäus Kiem.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For
details, see the full text of the licenses in the file LICENSE.
=cut
|