Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / XS / APItest.html
blob22bf74919e1b9609f0d99ed70dbf57e1ea6034b1
1 <?xml version="1.0" ?>
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">
4 <head>
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:" />
8 </head>
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">&nbsp;XS::APItest - Test the perl C API</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
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>
26 <ul>
28 <li><a href="#export">EXPORT</a></li>
29 </ul>
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>
34 </ul>
35 <!-- INDEX END -->
37 <hr />
38 <p>
39 </p>
40 <h1><a name="name">NAME</a></h1>
41 <p>XS::APItest - Test the perl C API</p>
42 <p>
43 </p>
44 <hr />
45 <h1><a name="synopsis">SYNOPSIS</a></h1>
46 <pre>
47 use XS::APItest;
48 print_double(4);</pre>
49 <p>
50 </p>
51 <hr />
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>
54 works correctly.</p>
55 <p>
56 </p>
57 <hr />
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>
63 <p>
64 </p>
65 <h2><a name="export">EXPORT</a></h2>
66 <p>Exports all the test functions:</p>
67 <dl>
68 <dt><strong><a name="item_print_double"><strong>print_double</strong></a></strong>
70 <dd>
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>
73 </dd>
74 <dd>
75 <pre>
76 print_double( $val );</pre>
77 </dd>
78 <dd>
79 <p>Output is sent to STDOUT.</p>
80 </dd>
81 </li>
82 <dt><strong><a name="item_print_long_double"><strong>print_long_double</strong></a></strong>
84 <dd>
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>
88 </dd>
89 <dd>
90 <pre>
91 print_long_double();</pre>
92 </dd>
93 <dd>
94 <p>Output is sent to STDOUT.</p>
95 </dd>
96 </li>
97 <dt><strong><a name="item_have_long_double"><strong>have_long_double</strong></a></strong>
99 <dd>
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>
102 </dd>
103 <dd>
104 <pre>
105 print_long_double() if have_long_double;</pre>
106 </dd>
107 </li>
108 <dt><strong><a name="item_print_nv"><strong>print_nv</strong></a></strong>
110 <dd>
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>
113 </dd>
114 <dd>
115 <pre>
116 print_nv( $val );</pre>
117 </dd>
118 <dd>
119 <p>Output is sent to STDOUT.</p>
120 </dd>
121 </li>
122 <dt><strong><a name="item_print_iv"><strong>print_iv</strong></a></strong>
124 <dd>
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>
127 </dd>
128 <dd>
129 <pre>
130 print_iv( $val );</pre>
131 </dd>
132 <dd>
133 <p>Output is sent to STDOUT.</p>
134 </dd>
135 </li>
136 <dt><strong><a name="item_print_uv"><strong>print_uv</strong></a></strong>
138 <dd>
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>
141 </dd>
142 <dd>
143 <pre>
144 print_uv( $val );</pre>
145 </dd>
146 <dd>
147 <p>Output is sent to STDOUT.</p>
148 </dd>
149 </li>
150 <dt><strong><a name="item_print_int"><strong>print_int</strong></a></strong>
152 <dd>
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>
155 </dd>
156 <dd>
157 <pre>
158 print_int( $val );</pre>
159 </dd>
160 <dd>
161 <p>Output is sent to STDOUT.</p>
162 </dd>
163 </li>
164 <dt><strong><a name="item_print_long"><strong>print_long</strong></a></strong>
166 <dd>
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>
169 </dd>
170 <dd>
171 <pre>
172 print_long( $val );</pre>
173 </dd>
174 <dd>
175 <p>Output is sent to STDOUT.</p>
176 </dd>
177 </li>
178 <dt><strong><a name="item_print_float"><strong>print_float</strong></a></strong>
180 <dd>
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>
183 </dd>
184 <dd>
185 <pre>
186 print_float( $val );</pre>
187 </dd>
188 <dd>
189 <p>Output is sent to STDOUT.</p>
190 </dd>
191 </li>
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>
194 <dd>
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>
199 </dd>
200 <dd>
201 <pre>
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>
204 </dd>
205 </li>
206 <dt><strong><a name="item_eval_sv"><strong>eval_sv</strong></a></strong>
208 <dd>
209 <p>Evaluates the passed SV. Result handling is done the same as for
210 <code>call_sv()</code> etc.</p>
211 </dd>
212 </li>
213 <dt><strong><a name="item_eval_pv"><strong>eval_pv</strong></a></strong>
215 <dd>
216 <p>Exercises the C function of the same name in scalar context. Returns the
217 same SV that the C function returns.</p>
218 </dd>
219 </li>
220 <dt><strong><a name="item_require_pv"><strong>require_pv</strong></a></strong>
222 <dd>
223 <p>Exercises the C function of the same name. Returns nothing.</p>
224 </dd>
225 </li>
226 </dl>
228 </p>
229 <hr />
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>
233 </p>
234 <hr />
235 <h1><a name="authors">AUTHORS</a></h1>
236 <p>Tim Jenness, &lt;<a href="mailto:t.jenness@jach.hawaii.edu">t.jenness@jach.hawaii.edu</a>&gt;,
237 Christian Soeller, &lt;<a href="mailto:csoelle@mph.auckland.ac.nz">csoelle@mph.auckland.ac.nz</a>&gt;,
238 Hugo van der Sanden &lt;<a href="mailto:hv@crypt.compulink.co.uk">hv@crypt.compulink.co.uk</a>&gt;</p>
240 </p>
241 <hr />
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">&nbsp;XS::APItest - Test the perl C API</span></strong></big>
250 </td></tr>
251 </table>
253 </body>
255 </html>