File: Entry.xs

package info (click to toggle)
libgit-raw-perl 0.90%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,540 kB
  • sloc: perl: 5,432; ansic: 182; makefile: 6
file content (78 lines) | stat: -rw-r--r-- 1,121 bytes parent folder | download | duplicates (4)
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
MODULE = Git::Raw			PACKAGE = Git::Raw::Tree::Entry

SV *
id(self)
	Tree_Entry self

	PREINIT:
		const git_oid *oid;

	CODE:
		oid = git_tree_entry_id(self);
		RETVAL = git_oid_to_sv((git_oid *) oid);

	OUTPUT: RETVAL

SV *
name(self)
	Tree_Entry self

	PREINIT:
		const char *name;

	CODE:
		name = git_tree_entry_name(self);
		RETVAL = newSVpv(name, 0);

	OUTPUT: RETVAL

SV *
file_mode(self)
	Tree_Entry self

	CODE:
		RETVAL = newSViv(git_tree_entry_filemode(self));

	OUTPUT: RETVAL

SV *
type(self)
	Tree_Entry self

	CODE:
		RETVAL = newSViv(git_tree_entry_type(self));

	OUTPUT:
		RETVAL

SV *
object(self)
	SV *self

	PREINIT:
		int rc;

		git_object *obj;
		Repository repo;

		Tree_Entry entry;

	CODE:
		repo = INT2PTR(Repository, SvIV((SV *) GIT_SV_TO_MAGIC(self)));

		entry = GIT_SV_TO_PTR(Tree::Entry, self);

		rc = git_tree_entry_to_object(&obj, repo -> repository, entry);
		git_check_error(rc);

		RETVAL = git_obj_to_sv(obj, GIT_SV_TO_MAGIC(self));

	OUTPUT: RETVAL

void
DESTROY(self)
	SV *self

	CODE:
		git_tree_entry_free(GIT_SV_TO_PTR(Tree::Entry, self));
		SvREFCNT_dec(GIT_SV_TO_MAGIC(self));