/
php.pmc
98 lines (68 loc) · 1.65 KB
/
php.pmc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
Copyright (C) 2008, The Perl Foundation.
=head1 NAME
src/pmc/php.pmc - Php native runtime
=head1 DESCRIPTION
This singleton PMC holds some static methods.
=head2 Methods
=over 4
=cut
*/
#include "pipp_private.h"
INTVAL dynpmc_PhpArray;
INTVAL dynpmc_PhpBoolean;
INTVAL dynpmc_PhpFloat;
INTVAL dynpmc_PhpInteger;
INTVAL dynpmc_PhpString;
INTVAL dynpmc_PhpNull;
static PMC * Php_PMC;
pmclass Php
singleton
dynpmc
group pipp_group {
/*
* Class initialization.
*/
void class_init() {
Php_PMC = NULL;
if (pass) {
dynpmc_PhpArray = pmc_type(INTERP,
Parrot_str_new_constant(INTERP, "PhpArray"));
dynpmc_PhpBoolean = pmc_type(INTERP,
Parrot_str_new_constant(INTERP, "PhpBoolean"));
dynpmc_PhpFloat = pmc_type(INTERP,
Parrot_str_new_constant(INTERP, "PhpFloat"));
dynpmc_PhpInteger = pmc_type(INTERP,
Parrot_str_new_constant(INTERP, "PhpInteger"));
dynpmc_PhpString = pmc_type(INTERP,
Parrot_str_new_constant(INTERP, "PhpString"));
dynpmc_PhpNull = pmc_type(INTERP,
Parrot_str_new_constant(INTERP, "PhpNull"));
}
}
/*
=item C<void* get_pointer()>
=item C<void set_pointer(void *ptr)>
These two functions are part of the singleton creation interface. For more
information see F<src/pmc.c>.
=cut
*/
void* get_pointer() {
return Php_PMC;
}
void set_pointer(void *ptr) {
Php_PMC = (PMC *)ptr;
}
}
/*
=back
=head1 AUTHORS
Francois Perrad
=cut
*/
/*
* Local variables:
* c-file-style: "parrot"
* End:
* vim: expandtab shiftwidth=4:
*/