← Index
NYTProf Performance Profile   « line view »
For /usr/local/libexec/sympa/task_manager-debug.pl
  Run on Tue Jun 1 22:32:51 2021
Reported on Tue Jun 1 22:35:07 2021

Filename/usr/local/lib/perl5/site_perl/Locale/gettext_xs.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sLocale::gettext_xs::::BEGIN@27Locale::gettext_xs::BEGIN@27
0000s0sLocale::gettext_xs::::__gettext_xs_versionLocale::gettext_xs::__gettext_xs_version (xsub)
0000s0sLocale::gettext_xs::::bindtextdomainLocale::gettext_xs::bindtextdomain
0000s0sLocale::gettext_xs::::bootstrapLocale::gettext_xs::bootstrap (xsub)
0000s0sLocale::gettext_xs::::dcnpgettextLocale::gettext_xs::dcnpgettext
0000s0sLocale::gettext_xs::::dcpgettextLocale::gettext_xs::dcpgettext
0000s0sLocale::gettext_xs::::dnpgettextLocale::gettext_xs::dnpgettext
0000s0sLocale::gettext_xs::::dpgettextLocale::gettext_xs::dpgettext
0000s0sLocale::gettext_xs::::nl_putenvLocale::gettext_xs::nl_putenv
0000s0sLocale::gettext_xs::::npgettextLocale::gettext_xs::npgettext
0000s0sLocale::gettext_xs::::pgettextLocale::gettext_xs::pgettext
0000s0sLocale::gettext_xs::::textdomainLocale::gettext_xs::textdomain
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#! /bin/false
2
3# vim: tabstop=4
4
5# Perl XS implementation of Uniforum message translation.
6# Copyright (C) 2002-2017 Guido Flohr <guido.flohr@cantanea.com>,
7# all rights reserved.
8
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation; either version 3 of the License, or
12# (at your option) any later version.
13
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18
19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22package Locale::gettext_xs;
23
24require DynaLoader;
25require Exporter;
26
27use vars qw (%EXPORT_TAGS @EXPORT_OK @ISA);
28
29%EXPORT_TAGS = (locale_h => [ qw (
30 gettext
31 dgettext
32 dcgettext
33 ngettext
34 dngettext
35 dcngettext
36 pgettext
37 dpgettext
38 dcpgettext
39 npgettext
40 dnpgettext
41 dcnpgettext
42 textdomain
43 bindtextdomain
44 bind_textdomain_codeset
45 )
46 ],
47 libintl_h => [ qw (LC_CTYPE
48 LC_NUMERIC
49 LC_TIME
50 LC_COLLATE
51 LC_MONETARY
52 LC_MESSAGES
53 LC_ALL)
54 ],
55 );
56
57@EXPORT_OK = qw (gettext
58 dgettext
59 dcgettext
60 ngettext
61 dngettext
62 dcngettext
63 pgettext
64 dpgettext
65 dcpgettext
66 npgettext
67 dnpgettext
68 dcnpgettext
69 textdomain
70 bindtextdomain
71 bind_textdomain_codeset
72 nl_putenv
73 setlocale
74 LC_CTYPE
75 LC_NUMERIC
76 LC_TIME
77 LC_COLLATE
78 LC_MONETARY
79 LC_MESSAGES
80 LC_ALL);
81@ISA = qw (Exporter DynaLoader);
82
83bootstrap Locale::gettext_xs;
84
85require File::Spec;
86
87# Reimplement pgettext functions
88sub pgettext ($$) {
89 my ($msgctxt, $msgid) = @_;
90
91 my $msg_ctxt_id = join("\004", $msgctxt, $msgid);
92 return Locale::gettext_xs::_pgettext_aux
93 ("", $msg_ctxt_id, $msgid, Locale::gettext_xs::LC_MESSAGES());
94}
95sub dpgettext ($$$) {
96 my ($domain, $msgctxt, $msgid) = @_;
97
98 my $msg_ctxt_id = join("\004", $msgctxt, $msgid);
99 return Locale::gettext_xs::_pgettext_aux
100 ($domain, $msg_ctxt_id, $msgid, Locale::gettext_xs::LC_MESSAGES());
101}
102sub dcpgettext ($$$$) {
103 my ($domain, $msgctxt, $msgid, $category) = @_;
104
105 my $msg_ctxt_id = join("\004", $msgctxt, $msgid);
106 return Locale::gettext_xs::_pgettext_aux
107 ($domain, $msg_ctxt_id, $msgid, $category);
108}
109
110# Reimplement npgettext functions
111sub npgettext ($$$$) {
112 my ($msgctxt, $msgid1, $msgid2, $n) = @_;
113
114 my $msg_ctxt_id = join("\004", $msgctxt, $msgid1);
115 return Locale::gettext_xs::_npgettext_aux
116 ("", $msg_ctxt_id, $msgid1, $msgid2, $n, Locale::gettext_xs::LC_MESSAGES());
117}
118sub dnpgettext ($$$$$) {
119 my ($domain, $msgctxt, $msgid1, $msgid2, $n) = @_;
120
121 my $msg_ctxt_id = join("\004", $msgctxt, $msgid1);
122 return Locale::gettext_xs::_npgettext_aux
123 ($domain, $msg_ctxt_id, $msgid1, $msgid2, $n, Locale::gettext_xs::LC_MESSAGES());
124}
125sub dcnpgettext ($$$$$$) {
126 my ($domain, $msgctxt, $msgid1, $msgid2, $n, $category) = @_;
127
128 my $msg_ctxt_id = join("\004", $msgctxt, $msgid1);
129 return Locale::gettext_xs::_npgettext_aux
130 ($domain, $msg_ctxt_id, $msgid1, $msgid2, $n, $category);
131}
132
133# Wrapper function that converts Perl paths to OS paths.
134sub bindtextdomain ($;$) {
135 my ($domain, $directory) = @_;
136
137 if (defined $domain && length $domain &&
138 defined $directory && length $directory) {
139 return Locale::gettext_xs::_bindtextdomain
140 ($domain, File::Spec->catdir ($directory));
141 } else {
142 return &Locale::gettext_xs::_bindtextdomain;
143 }
144}
145
146# In the XS version, making the prototype optional, does not work.
147sub textdomain (;$) {
148 my $domain = shift;
149
150 if (defined $domain) {
151 return Locale::gettext_xs::_textdomain ($domain);
152 } else {
153 return Locale::gettext_xs::_textdomain ("");
154 }
155}
156
157sub nl_putenv ($) {
158 my ($envspec) = @_;
159
160 return unless defined $envspec;
161 return unless length $envspec;
162 return if substr ($envspec, 0, 1) eq '=';
163
164 my ($var, $value) = split /=/, $envspec, 2;
165
166 if ($^O eq 'MSWin32') {
167 $value = '' unless defined $value;
168 return unless Locale::gettext_xs::_nl_putenv ("$var=$value") == 0;
169 if (length $value) {
170 $ENV{$var} = $value;
171 } else {
172 delete $ENV{$var};
173 }
174 } else {
175 if (defined $value) {
176 $ENV{$var} = $value;
177 } else {
178 delete $ENV{$var};
179 }
180 }
181
182 return 1;
183}
184
1851;
186
187__END__