xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/ext/XS/APItest/APItest.pm (revision 0:68f95e015346)
1*0Sstevel@tonic-gatepackage XS::APItest;
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gateuse 5.008;
4*0Sstevel@tonic-gateuse strict;
5*0Sstevel@tonic-gateuse warnings;
6*0Sstevel@tonic-gateuse Carp;
7*0Sstevel@tonic-gate
8*0Sstevel@tonic-gateuse base qw/ DynaLoader Exporter /;
9*0Sstevel@tonic-gate
10*0Sstevel@tonic-gate# Items to export into callers namespace by default. Note: do not export
11*0Sstevel@tonic-gate# names by default without a very good reason. Use EXPORT_OK instead.
12*0Sstevel@tonic-gate# Do not simply export all your public functions/methods/constants.
13*0Sstevel@tonic-gate
14*0Sstevel@tonic-gate# Export everything since these functions are only used by a test script
15*0Sstevel@tonic-gateour @EXPORT = qw( print_double print_int print_long
16*0Sstevel@tonic-gate		  print_float print_long_double have_long_double print_flush
17*0Sstevel@tonic-gate);
18*0Sstevel@tonic-gate
19*0Sstevel@tonic-gateour $VERSION = '0.03';
20*0Sstevel@tonic-gate
21*0Sstevel@tonic-gatebootstrap XS::APItest $VERSION;
22*0Sstevel@tonic-gate
23*0Sstevel@tonic-gate1;
24*0Sstevel@tonic-gate__END__
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gate=head1 NAME
27*0Sstevel@tonic-gate
28*0Sstevel@tonic-gateXS::APItest - Test the perl C API
29*0Sstevel@tonic-gate
30*0Sstevel@tonic-gate=head1 SYNOPSIS
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gate  use XS::APItest;
33*0Sstevel@tonic-gate  print_double(4);
34*0Sstevel@tonic-gate
35*0Sstevel@tonic-gate=head1 ABSTRACT
36*0Sstevel@tonic-gate
37*0Sstevel@tonic-gateThis module tests the perl C API. Currently tests that C<printf>
38*0Sstevel@tonic-gateworks correctly.
39*0Sstevel@tonic-gate
40*0Sstevel@tonic-gate=head1 DESCRIPTION
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gateThis module can be used to check that the perl C API is behaving
43*0Sstevel@tonic-gatecorrectly. This module provides test functions and an associated
44*0Sstevel@tonic-gatetest script that verifies the output.
45*0Sstevel@tonic-gate
46*0Sstevel@tonic-gateThis module is not meant to be installed.
47*0Sstevel@tonic-gate
48*0Sstevel@tonic-gate=head2 EXPORT
49*0Sstevel@tonic-gate
50*0Sstevel@tonic-gateExports all the test functions:
51*0Sstevel@tonic-gate
52*0Sstevel@tonic-gate=over 4
53*0Sstevel@tonic-gate
54*0Sstevel@tonic-gate=item B<print_double>
55*0Sstevel@tonic-gate
56*0Sstevel@tonic-gateTest that a double-precision floating point number is formatted
57*0Sstevel@tonic-gatecorrectly by C<printf>.
58*0Sstevel@tonic-gate
59*0Sstevel@tonic-gate  print_double( $val );
60*0Sstevel@tonic-gate
61*0Sstevel@tonic-gateOutput is sent to STDOUT.
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gate=item B<print_long_double>
64*0Sstevel@tonic-gate
65*0Sstevel@tonic-gateTest that a C<long double> is formatted correctly by
66*0Sstevel@tonic-gateC<printf>. Takes no arguments - the test value is hard-wired
67*0Sstevel@tonic-gateinto the function (as "7").
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate  print_long_double();
70*0Sstevel@tonic-gate
71*0Sstevel@tonic-gateOutput is sent to STDOUT.
72*0Sstevel@tonic-gate
73*0Sstevel@tonic-gate=item B<have_long_double>
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gateDetermine whether a C<long double> is supported by Perl.  This should
76*0Sstevel@tonic-gatebe used to determine whether to test C<print_long_double>.
77*0Sstevel@tonic-gate
78*0Sstevel@tonic-gate  print_long_double() if have_long_double;
79*0Sstevel@tonic-gate
80*0Sstevel@tonic-gate=item B<print_nv>
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gateTest that an C<NV> is formatted correctly by
83*0Sstevel@tonic-gateC<printf>.
84*0Sstevel@tonic-gate
85*0Sstevel@tonic-gate  print_nv( $val );
86*0Sstevel@tonic-gate
87*0Sstevel@tonic-gateOutput is sent to STDOUT.
88*0Sstevel@tonic-gate
89*0Sstevel@tonic-gate=item B<print_iv>
90*0Sstevel@tonic-gate
91*0Sstevel@tonic-gateTest that an C<IV> is formatted correctly by
92*0Sstevel@tonic-gateC<printf>.
93*0Sstevel@tonic-gate
94*0Sstevel@tonic-gate  print_iv( $val );
95*0Sstevel@tonic-gate
96*0Sstevel@tonic-gateOutput is sent to STDOUT.
97*0Sstevel@tonic-gate
98*0Sstevel@tonic-gate=item B<print_uv>
99*0Sstevel@tonic-gate
100*0Sstevel@tonic-gateTest that an C<UV> is formatted correctly by
101*0Sstevel@tonic-gateC<printf>.
102*0Sstevel@tonic-gate
103*0Sstevel@tonic-gate  print_uv( $val );
104*0Sstevel@tonic-gate
105*0Sstevel@tonic-gateOutput is sent to STDOUT.
106*0Sstevel@tonic-gate
107*0Sstevel@tonic-gate=item B<print_int>
108*0Sstevel@tonic-gate
109*0Sstevel@tonic-gateTest that an C<int> is formatted correctly by
110*0Sstevel@tonic-gateC<printf>.
111*0Sstevel@tonic-gate
112*0Sstevel@tonic-gate  print_int( $val );
113*0Sstevel@tonic-gate
114*0Sstevel@tonic-gateOutput is sent to STDOUT.
115*0Sstevel@tonic-gate
116*0Sstevel@tonic-gate=item B<print_long>
117*0Sstevel@tonic-gate
118*0Sstevel@tonic-gateTest that an C<long> is formatted correctly by
119*0Sstevel@tonic-gateC<printf>.
120*0Sstevel@tonic-gate
121*0Sstevel@tonic-gate  print_long( $val );
122*0Sstevel@tonic-gate
123*0Sstevel@tonic-gateOutput is sent to STDOUT.
124*0Sstevel@tonic-gate
125*0Sstevel@tonic-gate=item B<print_float>
126*0Sstevel@tonic-gate
127*0Sstevel@tonic-gateTest that a single-precision floating point number is formatted
128*0Sstevel@tonic-gatecorrectly by C<printf>.
129*0Sstevel@tonic-gate
130*0Sstevel@tonic-gate  print_float( $val );
131*0Sstevel@tonic-gate
132*0Sstevel@tonic-gateOutput is sent to STDOUT.
133*0Sstevel@tonic-gate
134*0Sstevel@tonic-gate=back
135*0Sstevel@tonic-gate
136*0Sstevel@tonic-gate=head1 SEE ALSO
137*0Sstevel@tonic-gate
138*0Sstevel@tonic-gateL<XS::Typemap>, L<perlapi>.
139*0Sstevel@tonic-gate
140*0Sstevel@tonic-gate=head1 AUTHORS
141*0Sstevel@tonic-gate
142*0Sstevel@tonic-gateTim Jenness, E<lt>t.jenness@jach.hawaii.eduE<gt>,
143*0Sstevel@tonic-gateChristian Soeller, E<lt>csoelle@mph.auckland.ac.nzE<gt>,
144*0Sstevel@tonic-gateHugo van der Sanden E<lt>hv@crypt.compulink.co.ukE<gt>
145*0Sstevel@tonic-gate
146*0Sstevel@tonic-gate=head1 COPYRIGHT AND LICENSE
147*0Sstevel@tonic-gate
148*0Sstevel@tonic-gateCopyright (C) 2002 Tim Jenness, Christian Soeller, Hugo van der Sanden.
149*0Sstevel@tonic-gateAll Rights Reserved.
150*0Sstevel@tonic-gate
151*0Sstevel@tonic-gateThis library is free software; you can redistribute it and/or modify
152*0Sstevel@tonic-gateit under the same terms as Perl itself.
153*0Sstevel@tonic-gate
154*0Sstevel@tonic-gate=cut
155