a24e7fb982acf50b7c17db199789b9149c16cac4
[p5sagit/p5-mst-13.2.git] / ext / XS / APItest / APItest.xs
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4
5 MODULE = XS::APItest            PACKAGE = XS::APItest
6
7 PROTOTYPES: DISABLE
8
9 void
10 print_double(val)
11         double val
12         CODE:
13         printf("%5.3f\n",val);
14
15 int
16 have_long_double()
17         CODE:
18 #ifdef HAS_LONG_DOUBLE
19         RETVAL = 1;
20 #else
21         RETVAL = 0;
22 #endif
23
24 void
25 print_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
37 void
38 print_nv(val)
39         NV val
40         CODE:
41         printf("%5.3Vf\n",val);
42
43 void
44 print_iv(val)
45         IV val
46         CODE:
47         printf("%Vd\n",val);
48
49 void
50 print_uv(val)
51         UV val
52         CODE:
53         printf("%Vu\n",val);
54
55 void
56 print_int(val)
57         int val
58         CODE:
59         printf("%d\n",val);
60
61 void
62 print_long(val)
63         long val
64         CODE:
65         printf("%ld\n",val);
66
67 void
68 print_float(val)
69         float val
70         CODE:
71         printf("%5.3f\n",val);