forked from RogerGee/php-git2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
treebuilder.h
165 lines (147 loc) · 4.97 KB
/
treebuilder.h
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
* treebuilder.h
*
* Copyright (C) Roger P. Gee
*/
#ifndef PHPGIT2_TREEBUILDER_H
#define PHPGIT2_TREEBUILDER_H
#include "tree.h"
namespace php_git2
{
// Provide specialization of git2_resource destructor for treebuilder.
template<> php_git_treebuilder::~git2_resource()
{
git_treebuilder_free(handle);
}
} // php_git2
// Template declarations for bindings:
static constexpr auto ZIF_GIT_TREEBUILDER_FREE = zif_php_git2_function_free<
php_git2::local_pack<
php_git2::php_resource_cleanup<php_git2::php_git_treebuilder>
>
>;
static constexpr auto ZIF_GIT_TREEBUILDER_NEW = zif_php_git2_function_setdeps<
php_git2::func_wrapper<
int,
git_treebuilder**,
git_repository*,
const git_tree*>::func<git_treebuilder_new>,
php_git2::local_pack<
php_git2::php_resource_ref<php_git2::php_git_treebuilder>,
php_git2::php_resource<php_git2::php_git_repository>,
php_git2::php_resource_nullable<php_git2::php_git_tree>
>,
php_git2::sequence<0,1>,
1,
php_git2::sequence<1,2>,
php_git2::sequence<0,1,2>
>;
static constexpr auto ZIF_GIT_TREEBUILDER_WRITE = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_oid*,
git_treebuilder*>::func<git_treebuilder_write>,
php_git2::local_pack<
php_git2::php_git_oid,
php_git2::php_resource<php_git2::php_git_treebuilder>
>,
1,
php_git2::sequence<1>,
php_git2::sequence<0,1>
>;
static constexpr auto ZIF_GIT_TREEBUILDER_INSERT = zif_php_git2_function_setdeps<
php_git2::func_wrapper<
int,
const git_tree_entry**,
git_treebuilder*,
const char*,
const git_oid*,
git_filemode_t>::func<git_treebuilder_insert>,
php_git2::local_pack<
const php_git2::php_resource_ref<php_git2::php_git_tree_entry_nofree>,
php_git2::php_resource<php_git2::php_git_treebuilder>,
php_git2::php_string,
php_git2::php_git_oid_fromstr,
php_git2::php_long_cast<git_filemode_t>
>,
php_git2::sequence<0,1>,
1,
php_git2::sequence<1,2,3,4>,
php_git2::sequence<0,1,2,3,4>
>;
static constexpr auto ZIF_GIT_TREEBUILDER_GET = zif_php_git2_function_rethandler<
php_git2::func_wrapper<
const git_tree_entry*,
git_treebuilder*,
const char*
>::func<git_treebuilder_get>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_treebuilder>,
php_git2::php_string
>,
php_git2::php_git_tree_entry_rethandler<
php_git2::php_resource<php_git2::php_git_treebuilder>,
php_git2::php_string
>
>;
static constexpr auto ZIF_GIT_TREEBUILDER_REMOVE = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_treebuilder*,
const char*>::func<git_treebuilder_remove>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_treebuilder>,
php_git2::php_string
>
>;
static constexpr auto ZIF_GIT_TREEBUILDER_CLEAR = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_treebuilder*>::func<git_treebuilder_clear>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_treebuilder>
>
>;
static constexpr auto ZIF_GIT_TREEBUILDER_ENTRYCOUNT = zif_php_git2_function<
php_git2::func_wrapper<
size_t,
git_treebuilder*>::func<git_treebuilder_entrycount>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_treebuilder>
>,
0
>;
static constexpr auto ZIF_GIT_TREEBUILDER_FILTER = zif_php_git2_function<
php_git2::func_wrapper<
int,
git_treebuilder*,
git_treebuilder_filter_cb,
void*>::func<git_treebuilder_filter>,
php_git2::local_pack<
php_git2::php_resource<php_git2::php_git_treebuilder>,
php_git2::php_callback_handler<php_git2::treebuilder_filter_callback>,
php_git2::php_callback_sync
>,
-1,
php_git2::sequence<0,2,2>, // pass callback in twice for function and payload
php_git2::sequence<0,1,2>
>;
// PHP function entry macro for this module:
#define GIT_TREEBUILDER_FE \
PHP_GIT2_FE(git_treebuilder_free,ZIF_GIT_TREEBUILDER_FREE,NULL) \
PHP_GIT2_FE(git_treebuilder_new,ZIF_GIT_TREEBUILDER_NEW,NULL) \
PHP_GIT2_FE(git_treebuilder_write,ZIF_GIT_TREEBUILDER_WRITE,NULL) \
PHP_GIT2_FE(git_treebuilder_insert,ZIF_GIT_TREEBUILDER_INSERT,NULL) \
PHP_GIT2_FE(git_treebuilder_get,ZIF_GIT_TREEBUILDER_GET,NULL) \
PHP_GIT2_FE(git_treebuilder_remove,ZIF_GIT_TREEBUILDER_REMOVE,NULL) \
PHP_GIT2_FE(git_treebuilder_clear,ZIF_GIT_TREEBUILDER_CLEAR,NULL) \
PHP_GIT2_FE(git_treebuilder_entrycount,ZIF_GIT_TREEBUILDER_ENTRYCOUNT,NULL) \
PHP_GIT2_FE(git_treebuilder_filter,ZIF_GIT_TREEBUILDER_FILTER,NULL)
#endif
/*
* Local Variables:
* mode:c++
* indent-tabs-mode:nil
* tab-width:4
* End:
*/