2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>XS::APItest - Test the perl C API
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> XS::APItest - Test the perl C API
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#synopsis">SYNOPSIS
</a></li>
24 <li><a href=
"#abstract">ABSTRACT
</a></li>
25 <li><a href=
"#description">DESCRIPTION
</a></li>
28 <li><a href=
"#export">EXPORT
</a></li>
31 <li><a href=
"#see_also">SEE ALSO
</a></li>
32 <li><a href=
"#authors">AUTHORS
</a></li>
33 <li><a href=
"#copyright_and_license">COPYRIGHT AND LICENSE
</a></li>
40 <h1><a name=
"name">NAME
</a></h1>
41 <p>XS::APItest - Test the perl C API
</p>
45 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
48 print_double(
4);
</pre>
52 <h1><a name=
"abstract">ABSTRACT
</a></h1>
53 <p>This module tests the perl C API. Currently tests that
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>
58 <h1><a name=
"description">DESCRIPTION
</a></h1>
59 <p>This module can be used to check that the perl C API is behaving
60 correctly. This module provides test functions and an associated
61 test script that verifies the output.
</p>
62 <p>This module is not meant to be installed.
</p>
65 <h2><a name=
"export">EXPORT
</a></h2>
66 <p>Exports all the test functions:
</p>
68 <dt><strong><a name=
"item_print_double"><strong>print_double
</strong></a></strong>
71 <p>Test that a double-precision floating point number is formatted
72 correctly by
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>.
</p>
76 print_double( $val );
</pre>
79 <p>Output is sent to STDOUT.
</p>
82 <dt><strong><a name=
"item_print_long_double"><strong>print_long_double
</strong></a></strong>
85 <p>Test that a
<code>long double
</code> is formatted correctly by
86 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>. Takes no arguments - the test value is hard-wired
87 into the function (as ``
7'').
</p>
91 print_long_double();
</pre>
94 <p>Output is sent to STDOUT.
</p>
97 <dt><strong><a name=
"item_have_long_double"><strong>have_long_double
</strong></a></strong>
100 <p>Determine whether a
<code>long double
</code> is supported by Perl. This should
101 be used to determine whether to test
<a href=
"#item_print_long_double"><code>print_long_double
</code></a>.
</p>
105 print_long_double() if have_long_double;
</pre>
108 <dt><strong><a name=
"item_print_nv"><strong>print_nv
</strong></a></strong>
111 <p>Test that an
<code>NV
</code> is formatted correctly by
112 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>.
</p>
116 print_nv( $val );
</pre>
119 <p>Output is sent to STDOUT.
</p>
122 <dt><strong><a name=
"item_print_iv"><strong>print_iv
</strong></a></strong>
125 <p>Test that an
<code>IV
</code> is formatted correctly by
126 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>.
</p>
130 print_iv( $val );
</pre>
133 <p>Output is sent to STDOUT.
</p>
136 <dt><strong><a name=
"item_print_uv"><strong>print_uv
</strong></a></strong>
139 <p>Test that an
<code>UV
</code> is formatted correctly by
140 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>.
</p>
144 print_uv( $val );
</pre>
147 <p>Output is sent to STDOUT.
</p>
150 <dt><strong><a name=
"item_print_int"><strong>print_int
</strong></a></strong>
153 <p>Test that an
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_int"><code>int
</code></a> is formatted correctly by
154 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>.
</p>
158 print_int( $val );
</pre>
161 <p>Output is sent to STDOUT.
</p>
164 <dt><strong><a name=
"item_print_long"><strong>print_long
</strong></a></strong>
167 <p>Test that an
<code>long
</code> is formatted correctly by
168 <a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>.
</p>
172 print_long( $val );
</pre>
175 <p>Output is sent to STDOUT.
</p>
178 <dt><strong><a name=
"item_print_float"><strong>print_float
</strong></a></strong>
181 <p>Test that a single-precision floating point number is formatted
182 correctly by
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_printf"><code>printf
</code></a>.
</p>
186 print_float( $val );
</pre>
189 <p>Output is sent to STDOUT.
</p>
192 <dt><strong><a name=
"item_call_sv_2c_call_pv_2c_call_method"><strong>call_sv
</strong>,
<strong>call_pv
</strong>,
<strong>call_method
</strong></a></strong>
195 <p>These exercise the C calls of the same names. Everything after the flags
196 arg is passed as the the args to the called function. They return whatever
197 the C function itself pushed onto the stack, plus the return value from
198 the function; for example
</p>
202 call_sv( sub { @_, 'c' }, G_ARRAY, 'a', 'b'); # returns 'a', 'b', 'c',
3
203 call_sv( sub { @_ }, G_SCALAR, 'a', 'b'); # returns 'b',
1</pre>
206 <dt><strong><a name=
"item_eval_sv"><strong>eval_sv
</strong></a></strong>
209 <p>Evaluates the passed SV. Result handling is done the same as for
210 <code>call_sv()
</code> etc.
</p>
213 <dt><strong><a name=
"item_eval_pv"><strong>eval_pv
</strong></a></strong>
216 <p>Exercises the C function of the same name in scalar context. Returns the
217 same SV that the C function returns.
</p>
220 <dt><strong><a name=
"item_require_pv"><strong>require_pv
</strong></a></strong>
223 <p>Exercises the C function of the same name. Returns nothing.
</p>
230 <h1><a name=
"see_also">SEE ALSO
</a></h1>
231 <p><a href=
"file://C|\msysgit\mingw\html/lib/XS/Typemap.html">the XS::Typemap manpage
</a>,
<a href=
"file://C|\msysgit\mingw\html/pod/perlapi.html">the perlapi manpage
</a>.
</p>
235 <h1><a name=
"authors">AUTHORS
</a></h1>
236 <p>Tim Jenness,
<<a href=
"mailto:t.jenness@jach.hawaii.edu">t.jenness@jach.hawaii.edu
</a>>,
237 Christian Soeller,
<<a href=
"mailto:csoelle@mph.auckland.ac.nz">csoelle@mph.auckland.ac.nz
</a>>,
238 Hugo van der Sanden
<<a href=
"mailto:hv@crypt.compulink.co.uk">hv@crypt.compulink.co.uk
</a>></p>
242 <h1><a name=
"copyright_and_license">COPYRIGHT AND LICENSE
</a></h1>
243 <p>Copyright (C)
2002,
2004 Tim Jenness, Christian Soeller, Hugo van der Sanden.
244 All Rights Reserved.
</p>
245 <p>This library is free software; you can redistribute it and/or modify
246 it under the same terms as Perl itself.
</p>
247 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
248 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
249 <big><strong><span class=
"block"> XS::APItest - Test the perl C API
</span></strong></big>