This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
C++: class is a keyword
[perl5.git] / lib / ExtUtils / ParseXS / t / XSTest.xs
CommitLineData
6b09c160
YST
1#include "EXTERN.h"
2#include "perl.h"
3#include "XSUB.h"
4
5void
6xstest_something (char * some_thing)
7{
8 some_thing = some_thing;
9}
10
11void
12xstest_something2 (char * some_thing)
13{
14 some_thing = some_thing;
15}
16
17
18MODULE = XSTest PACKAGE = XSTest PREFIX = xstest_
19
20PROTOTYPES: DISABLE
21
22int
23is_even(input)
24 int input
25 CODE:
26 RETVAL = (input % 2 == 0);
27 OUTPUT:
28 RETVAL
29
30void
56ed3373 31xstest_something (myclass, some_thing)
6b09c160
YST
32 char * some_thing
33 C_ARGS:
34 some_thing
35
36void
37xstest_something2 (some_thing)
38 char * some_thing
39
40void
56ed3373
JH
41xstest_something3 (myclass, some_thing)
42 SV * myclass
6b09c160
YST
43 char * some_thing
44 PREINIT:
22022115 45 int i = 0;
6b09c160
YST
46 PPCODE:
47 /* it's up to us clear these warnings */
56ed3373 48 myclass = myclass;
6b09c160
YST
49 some_thing = some_thing;
50 i = i;
51 XSRETURN_UNDEF;
52
53int
56ed3373
JH
54consts (myclass)
55 SV * myclass
6b09c160
YST
56 ALIAS:
57 const_one = 1
58 const_two = 2
59 const_three = 3
60 CODE:
61 /* it's up to us clear these warnings */
56ed3373 62 myclass = myclass;
6b09c160
YST
63 ix = ix;
64 RETVAL = 1;
65 OUTPUT:
66 RETVAL
67