line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "perlbolt.h" |
2
|
|
|
|
|
|
|
#include "ingyINLINE.h" |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
#define NVCLASS "Neo4j::Bolt::NeoValue" |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
struct neovalue { |
7
|
|
|
|
|
|
|
neo4j_value_t value; |
8
|
|
|
|
|
|
|
}; |
9
|
|
|
|
|
|
|
typedef struct neovalue neovalue_t; |
10
|
|
|
|
|
|
|
|
11
|
13
|
|
|
|
|
|
SV *_new_from_perl (const char* classname, SV *v) { |
12
|
|
|
|
|
|
|
SV *neosv, *neosv_ref; |
13
|
|
|
|
|
|
|
neovalue_t *obj; |
14
|
13
|
|
|
|
|
|
Newx(obj, 1, neovalue_t); |
15
|
13
|
|
|
|
|
|
obj->value = SV_to_neo4j_value(v); |
16
|
13
|
|
|
|
|
|
neosv = newSViv((IV) obj); |
17
|
13
|
|
|
|
|
|
neosv_ref = newRV_noinc(neosv); |
18
|
13
|
|
|
|
|
|
sv_bless(neosv_ref, gv_stashpv(classname, GV_ADD)); |
19
|
13
|
|
|
|
|
|
SvREADONLY_on(neosv); |
20
|
13
|
|
|
|
|
|
return neosv_ref; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
13
|
|
|
|
|
|
const char* _neotype (SV *obj) { |
24
|
|
|
|
|
|
|
neo4j_value_t v; |
25
|
13
|
50
|
|
|
|
|
v = C_PTR_OF(obj,neovalue_t)->value; |
26
|
13
|
|
|
|
|
|
return neo4j_typestr( neo4j_type( v ) ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
13
|
|
|
|
|
|
SV* _as_perl (SV *obj) { |
30
|
|
|
|
|
|
|
SV *ret; |
31
|
13
|
|
|
|
|
|
ret = newSV(0); |
32
|
13
|
50
|
|
|
|
|
sv_setsv(ret,neo4j_value_to_SV( C_PTR_OF(obj, neovalue_t)->value )); |
33
|
13
|
|
|
|
|
|
return ret; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
int _map_size (SV *obj) { |
37
|
0
|
0
|
|
|
|
|
return neo4j_map_size( C_PTR_OF(obj, neovalue_t)->value ); |
38
|
|
|
|
|
|
|
} |
39
|
13
|
|
|
|
|
|
void DESTROY(SV *obj) { |
40
|
13
|
50
|
|
|
|
|
neo4j_value_t *val = C_PTR_OF(obj, neo4j_value_t); |
41
|
13
|
|
|
|
|
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
MODULE = Neo4j::Bolt::NeoValue PACKAGE = Neo4j::Bolt::NeoValue |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
SV * |
51
|
|
|
|
|
|
|
_new_from_perl (classname, v) |
52
|
|
|
|
|
|
|
const char * classname |
53
|
|
|
|
|
|
|
SV * v |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
const char * |
56
|
|
|
|
|
|
|
_neotype (obj) |
57
|
|
|
|
|
|
|
SV * obj |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
SV * |
60
|
|
|
|
|
|
|
_as_perl (obj) |
61
|
|
|
|
|
|
|
SV * obj |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
int |
64
|
|
|
|
|
|
|
_map_size (obj) |
65
|
|
|
|
|
|
|
SV * obj |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
void |
68
|
|
|
|
|
|
|
DESTROY (obj) |
69
|
|
|
|
|
|
|
SV * obj |
70
|
|
|
|
|
|
|
PREINIT: |
71
|
|
|
|
|
|
|
I32* temp; |
72
|
|
|
|
|
|
|
PPCODE: |
73
|
13
|
|
|
|
|
|
temp = PL_markstack_ptr++; |
74
|
13
|
|
|
|
|
|
DESTROY(obj); |
75
|
13
|
50
|
|
|
|
|
if (PL_markstack_ptr != temp) { |
76
|
|
|
|
|
|
|
/* truly void, because dXSARGS not invoked */ |
77
|
13
|
|
|
|
|
|
PL_markstack_ptr = temp; |
78
|
13
|
|
|
|
|
|
XSRETURN_EMPTY; /* return empty stack */ |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
/* must have used dXSARGS; list context implied */ |
81
|
0
|
|
|
|
|
|
return; /* assume stack size is correct */ |
82
|
|
|
|
|
|
|
|