| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
MODULE = Git::Raw PACKAGE = Git::Raw::Blame |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
SV * |
|
4
|
|
|
|
|
|
|
hunk_count(self) |
|
5
|
|
|
|
|
|
|
Blame self |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
CODE: |
|
8
|
2
|
|
|
|
|
|
RETVAL = newSVuv(git_blame_get_hunk_count(self)); |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
OUTPUT: RETVAL |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
void |
|
13
|
|
|
|
|
|
|
hunks(self, ...) |
|
14
|
|
|
|
|
|
|
SV *self |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
PROTOTYPE: $;$ |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
PREINIT: |
|
19
|
5
|
|
|
|
|
|
size_t start = 0, end, num_hunks; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
PPCODE: |
|
22
|
5
|
|
|
|
|
|
num_hunks = git_blame_get_hunk_count(GIT_SV_TO_PTR(Blame, self)); |
|
23
|
|
|
|
|
|
|
|
|
24
|
5
|
100
|
|
|
|
|
if (items == 2) { |
|
25
|
4
|
|
|
|
|
|
SV *index = ST(1); |
|
26
|
|
|
|
|
|
|
|
|
27
|
4
|
100
|
|
|
|
|
if (!SvIOK(index) || SvIV(index) < 0) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
28
|
1
|
|
|
|
|
|
croak_usage("Invalid type for 'index'"); |
|
29
|
|
|
|
|
|
|
|
|
30
|
3
|
50
|
|
|
|
|
start = SvUV(index); |
|
31
|
3
|
100
|
|
|
|
|
if (start >= num_hunks) |
|
32
|
1
|
|
|
|
|
|
croak_usage("index %" PRIuZ " out of range", start); |
|
33
|
|
|
|
|
|
|
|
|
34
|
2
|
|
|
|
|
|
num_hunks = 1; |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
3
|
|
|
|
|
|
end = start + num_hunks; |
|
38
|
|
|
|
|
|
|
|
|
39
|
8
|
100
|
|
|
|
|
for (; start < end; ++start) { |
|
40
|
|
|
|
|
|
|
SV *hunk; |
|
41
|
|
|
|
|
|
|
|
|
42
|
5
|
|
|
|
|
|
const git_blame_hunk *h = |
|
43
|
5
|
|
|
|
|
|
git_blame_get_hunk_byindex(GIT_SV_TO_PTR(Blame, self), |
|
44
|
|
|
|
|
|
|
start); |
|
45
|
|
|
|
|
|
|
|
|
46
|
5
|
|
|
|
|
|
GIT_NEW_OBJ_WITH_MAGIC( |
|
47
|
|
|
|
|
|
|
hunk, "Git::Raw::Blame::Hunk", |
|
48
|
|
|
|
|
|
|
(Blame_Hunk) h, SvRV(self) |
|
49
|
|
|
|
|
|
|
); |
|
50
|
|
|
|
|
|
|
|
|
51
|
5
|
50
|
|
|
|
|
mXPUSHs(hunk); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
3
|
|
|
|
|
|
XSRETURN(num_hunks); |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
SV * |
|
57
|
|
|
|
|
|
|
buffer(self, buffer) |
|
58
|
|
|
|
|
|
|
SV *self |
|
59
|
|
|
|
|
|
|
SV *buffer |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
PREINIT: |
|
62
|
|
|
|
|
|
|
int rc; |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Blame blame; |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
const char *text; |
|
67
|
|
|
|
|
|
|
STRLEN len; |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
CODE: |
|
70
|
1
|
|
|
|
|
|
text = git_ensure_pv_with_len(buffer, "buffer", &len); |
|
71
|
|
|
|
|
|
|
|
|
72
|
1
|
|
|
|
|
|
rc = git_blame_buffer( |
|
73
|
1
|
|
|
|
|
|
&blame, GIT_SV_TO_PTR(Blame, self), |
|
74
|
|
|
|
|
|
|
text, len); |
|
75
|
1
|
|
|
|
|
|
git_check_error(rc); |
|
76
|
|
|
|
|
|
|
|
|
77
|
1
|
|
|
|
|
|
GIT_NEW_OBJ_WITH_MAGIC( |
|
78
|
|
|
|
|
|
|
RETVAL, "Git::Raw::Blame", |
|
79
|
|
|
|
|
|
|
blame, SvRV(self)); |
|
80
|
|
|
|
|
|
|
OUTPUT: RETVAL |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
SV * |
|
83
|
|
|
|
|
|
|
line(self, line_no) |
|
84
|
|
|
|
|
|
|
SV *self |
|
85
|
|
|
|
|
|
|
size_t line_no |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
PREINIT: |
|
88
|
|
|
|
|
|
|
const git_blame_hunk *h; |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
CODE: |
|
91
|
2
|
100
|
|
|
|
|
if ((h = git_blame_get_hunk_byline( |
|
92
|
2
|
|
|
|
|
|
GIT_SV_TO_PTR(Blame, self), line_no))) { |
|
93
|
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
|
GIT_NEW_OBJ_WITH_MAGIC( |
|
95
|
|
|
|
|
|
|
RETVAL, "Git::Raw::Blame::Hunk", |
|
96
|
|
|
|
|
|
|
(Blame_Hunk) h, SvRV(self) |
|
97
|
|
|
|
|
|
|
); |
|
98
|
|
|
|
|
|
|
} else { |
|
99
|
1
|
|
|
|
|
|
RETVAL = &PL_sv_undef; |
|
100
|
|
|
|
|
|
|
} |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
OUTPUT: RETVAL |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
void |
|
105
|
|
|
|
|
|
|
DESTROY(self) |
|
106
|
|
|
|
|
|
|
SV *self |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
CODE: |
|
109
|
2
|
|
|
|
|
|
git_blame_free(GIT_SV_TO_PTR(Blame, self)); |
|
110
|
2
|
|
|
|
|
|
SvREFCNT_dec(GIT_SV_TO_MAGIC(self)); |