-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv10.xs
100 lines (83 loc) · 1.5 KB
/
v10.xs
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
99
100
#define PERL_NO_GET_CONTEXT
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "const-c.inc"
#include "src/hv.h"
static void release(SV *sv, pTHX) {
sv_2mortal(sv);
}
MODULE = Hash::v10 PACKAGE = Hash::v10
INCLUDE: const-xs.inc
PROTOTYPES: DISABLE
Hash
TIEHASH(classname)
SV *classname
CODE:
RETVAL = hash_new((void (*)(Hval, void *))release, (void *)aTHX);
OUTPUT:
RETVAL
SV *
FETCH(this, key)
Hash this
Hkey key
CODE:
RETVAL = SvREFCNT_inc(hash_fetch(this, key));
OUTPUT:
RETVAL
void
STORE(this, key, val)
Hash this
Hkey key
SV *val
CODE:
hash_store(this, key, SvREFCNT_inc(val));
SV *
DELETE(this, key)
Hash this
Hkey key
CODE:
RETVAL = SvREFCNT_inc(hash_delete(this, key));
OUTPUT:
RETVAL
void
CLEAR(this)
Hash this
CODE:
hash_clear(this);
int
EXISTS(this, key)
Hash this
Hkey key
CODE:
RETVAL = hash_exists(this, key);
OUTPUT:
RETVAL
Hkey
FIRSTKEY(this)
Hash this
CODE:
RETVAL = hash_firstkey(this);
OUTPUT:
RETVAL
Hkey
NEXTKEY(this, lastkey)
Hash this
Hkey lastkey
CODE:
RETVAL = hash_nextkey(this);
OUTPUT:
RETVAL
Hkey
SCALAR(this)
Hash this
CODE:
RETVAL = hash_scalar(this);
OUTPUT:
RETVAL
void
DESTROY(this)
Hash this
CODE:
hash_free(this);