Clear up most of the VC6 compiler warnings in the following smoke:
[p5sagit/p5-mst-13.2.git] / ext / XS / APItest / APItest.pm
CommitLineData
3e61d65a 1package XS::APItest;
2
3use 5.008;
4use strict;
5use warnings;
6use Carp;
7
8use base qw/ DynaLoader Exporter /;
9
10# Items to export into callers namespace by default. Note: do not export
11# names by default without a very good reason. Use EXPORT_OK instead.
12# Do not simply export all your public functions/methods/constants.
13
14# Export everything since these functions are only used by a test script
deec275f 15our @EXPORT = qw( print_double print_int print_long
9d911683 16 print_float print_long_double have_long_double print_flush
d4b90eee 17 mpushp mpushn mpushi mpushu
18 mxpushp mxpushn mxpushi mxpushu
d1f347d7 19 call_sv call_pv call_method eval_sv eval_pv require_pv
20 G_SCALAR G_ARRAY G_VOID G_DISCARD G_EVAL G_NOARGS
21 G_KEEPERR G_NODEBUG G_METHOD
5d2b1485 22 exception mycroak strtab
85ce96a1 23 my_cxt_getint my_cxt_getsv my_cxt_setint my_cxt_setsv
3e61d65a 24);
25
d1f347d7 26# from cop.h
27sub G_SCALAR() { 0 }
28sub G_ARRAY() { 1 }
29sub G_VOID() { 128 }
30sub G_DISCARD() { 2 }
31sub G_EVAL() { 4 }
32sub G_NOARGS() { 8 }
33sub G_KEEPERR() { 16 }
34sub G_NODEBUG() { 32 }
35sub G_METHOD() { 64 }
36
85ce96a1 37our $VERSION = '0.09';
3e61d65a 38
39bootstrap XS::APItest $VERSION;
40
411;
42__END__
43
44=head1 NAME
45
46XS::APItest - Test the perl C API
47
48=head1 SYNOPSIS
49
50 use XS::APItest;
51 print_double(4);
52
53=head1 ABSTRACT
54
55This module tests the perl C API. Currently tests that C<printf>
56works correctly.
57
58=head1 DESCRIPTION
59
60This module can be used to check that the perl C API is behaving
61correctly. This module provides test functions and an associated
62test script that verifies the output.
63
64This module is not meant to be installed.
65
66=head2 EXPORT
67
68Exports all the test functions:
69
70=over 4
71
72=item B<print_double>
73
74Test that a double-precision floating point number is formatted
75correctly by C<printf>.
76
77 print_double( $val );
78
79Output is sent to STDOUT.
80
81=item B<print_long_double>
82
83Test that a C<long double> is formatted correctly by
84C<printf>. Takes no arguments - the test value is hard-wired
85into the function (as "7").
86
87 print_long_double();
88
89Output is sent to STDOUT.
90
91=item B<have_long_double>
92
93Determine whether a C<long double> is supported by Perl. This should
94be used to determine whether to test C<print_long_double>.
95
96 print_long_double() if have_long_double;
97
98=item B<print_nv>
99
100Test that an C<NV> is formatted correctly by
101C<printf>.
102
103 print_nv( $val );
104
105Output is sent to STDOUT.
106
107=item B<print_iv>
108
109Test that an C<IV> is formatted correctly by
110C<printf>.
111
112 print_iv( $val );
113
114Output is sent to STDOUT.
115
116=item B<print_uv>
117
118Test that an C<UV> is formatted correctly by
119C<printf>.
120
121 print_uv( $val );
122
123Output is sent to STDOUT.
124
125=item B<print_int>
126
127Test that an C<int> is formatted correctly by
128C<printf>.
129
130 print_int( $val );
131
132Output is sent to STDOUT.
133
134=item B<print_long>
135
136Test that an C<long> is formatted correctly by
137C<printf>.
138
139 print_long( $val );
140
141Output is sent to STDOUT.
142
143=item B<print_float>
144
145Test that a single-precision floating point number is formatted
146correctly by C<printf>.
147
148 print_float( $val );
149
150Output is sent to STDOUT.
151
d1f347d7 152=item B<call_sv>, B<call_pv>, B<call_method>
153
154These exercise the C calls of the same names. Everything after the flags
155arg is passed as the the args to the called function. They return whatever
156the C function itself pushed onto the stack, plus the return value from
157the function; for example
158
159 call_sv( sub { @_, 'c' }, G_ARRAY, 'a', 'b'); # returns 'a', 'b', 'c', 3
160 call_sv( sub { @_ }, G_SCALAR, 'a', 'b'); # returns 'b', 1
161
162=item B<eval_sv>
163
3c4b39be 164Evaluates the passed SV. Result handling is done the same as for
d1f347d7 165C<call_sv()> etc.
166
167=item B<eval_pv>
168
3c4b39be 169Exercises the C function of the same name in scalar context. Returns the
d1f347d7 170same SV that the C function returns.
171
172=item B<require_pv>
173
3c4b39be 174Exercises the C function of the same name. Returns nothing.
d1f347d7 175
3e61d65a 176=back
177
178=head1 SEE ALSO
179
180L<XS::Typemap>, L<perlapi>.
181
182=head1 AUTHORS
183
184Tim Jenness, E<lt>t.jenness@jach.hawaii.eduE<gt>,
185Christian Soeller, E<lt>csoelle@mph.auckland.ac.nzE<gt>,
186Hugo van der Sanden E<lt>hv@crypt.compulink.co.ukE<gt>
187
188=head1 COPYRIGHT AND LICENSE
189
d1f347d7 190Copyright (C) 2002,2004 Tim Jenness, Christian Soeller, Hugo van der Sanden.
3e61d65a 191All Rights Reserved.
192
193This library is free software; you can redistribute it and/or modify
194it under the same terms as Perl itself.
195
196=cut