This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add XS::APItest 0.01 from Tim Jenness.
[perl5.git] / ext / XS / APItest / APItest.xs
CommitLineData
3e61d65a
JH
1#include "EXTERN.h"
2#include "perl.h"
3#include "XSUB.h"
4
5MODULE = XS::APItest PACKAGE = XS::APItest
6
7PROTOTYPES: DISABLE
8
9void
10print_double(val)
11 double val
12 CODE:
13 printf("%5.3f\n",val);
14
15int
16have_long_double()
17 CODE:
18#ifdef HAS_LONG_DOUBLE
19 RETVAL = 1;
20#else
21 RETVAL = 0;
22#endif
23
24void
25print_long_double()
26 CODE:
27#ifdef HAS_LONG_DOUBLE
28# if LONG_DOUBLESIZE > DOUBLESIZE
29 long double val = 7.0;
30 printf("%5.3" PERL_PRIfldbl "\n",val);
31# else
32 double val = 7.0;
33 printf("%5.3f\n",val);
34# endif
35#endif
36
37void
38print_nv(val)
39 NV val
40 CODE:
41 printf("%5.3Vf\n",val);
42
43void
44print_iv(val)
45 IV val
46 CODE:
47 printf("%Vd\n",val);
48
49void
50print_uv(val)
51 UV val
52 CODE:
53 printf("%Vu\n",val);
54
55void
56print_int(val)
57 int val
58 CODE:
59 printf("%d\n",val);
60
61void
62print_long(val)
63 long val
64 CODE:
65 printf("%ld\n",val);
66
67void
68print_float(val)
69 float val
70 CODE:
71 printf("%5.3f\n",val);