forked from libgit2/php-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphp_git.h
More file actions
196 lines (165 loc) · 5.56 KB
/
php_git.h
File metadata and controls
196 lines (165 loc) · 5.56 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
* The MIT License
*
* Copyright (c) 2010 - 2011 Shuhei Tanuma
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef PHP_GIT_H
#define PHP_GIT_H
#define PHP_GIT_EXTNAME "git"
#define PHP_GIT_EXTVER "0.2.1"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "ext/spl/spl_exceptions.h"
#include <git2.h>
#include <git2/odb_backend.h>
/* Define the entry point symbol
* Zend will use when loading this module
*/
extern zend_module_entry git_module_entry;
#define phpext_git_ptr &git_module_entry;
#define PHP_GIT_NS "Git"
void php_git_throw_exception(zend_class_entry *exception,int error_code, char *message TSRMLS_DC);
int php_git_add_protected_property_zval_ex(zval *object, char *name, int name_length, zval *data TSRMLS_DC);
int php_git_add_protected_property_string_ex(zval *object, char *name, int name_length, char *data, zend_bool duplicate TSRMLS_DC);
int php_git_odb_init(zval **object, git_odb *database TSRMLS_DC);
zval* php_git_read_protected_property(zend_class_entry *scope, zval *object, char *name, int name_length TSRMLS_DC);
void php_git_commit_init(zval **object, git_commit *commit, git_repository *repository TSRMLS_DC);
int git_tree_entry_resolve_byname(git_tree_entry **object, git_tree *tree, git_repository* repository, const char *path);
extern PHPAPI zend_class_entry *git_class_entry;
extern PHPAPI zend_class_entry *git_reference_class_entry;
extern PHPAPI zend_class_entry *git_reference_manager_class_entry;
extern PHPAPI zend_class_entry *git_repository_class_entry;
extern PHPAPI zend_class_entry *git_object_class_entry;
extern PHPAPI zend_class_entry *git_index_class_entry;
extern PHPAPI zend_class_entry *git_index_iterator_class_entry;
extern PHPAPI zend_class_entry *git_index_entry_class_entry;
extern PHPAPI zend_class_entry *git_walker_class_entry;
extern PHPAPI zend_class_entry *git_tree_class_entry;
extern PHPAPI zend_class_entry *git_tree_builder_class_entry;
extern PHPAPI zend_class_entry *git_tree_iterator_class_entry;
extern PHPAPI zend_class_entry *git_tree_entry_class_entry;
extern PHPAPI zend_class_entry *git_commit_class_entry;
extern PHPAPI zend_class_entry *git_signature_class_entry;
extern PHPAPI zend_class_entry *git_tag_class_entry;
extern PHPAPI zend_class_entry *git_blob_class_entry;
extern PHPAPI zend_class_entry *git_odb_class_entry;
extern PHPAPI zend_class_entry *git_backend_class_entry;
extern PHPAPI zend_class_entry *git_rawobject_class_entry;
extern PHPAPI zend_class_entry *git_config_class_entry;
typedef struct{
zend_object zo;
git_index *index;
} php_git_index_t;
typedef struct{
zend_object zo;
git_index *index;
long offset;
} php_git_index_iterator_t;
typedef struct{
zend_object zo;
git_repository *repository;
} php_git_repository_t;
typedef struct{
zend_object zo;
git_treebuilder *builder;
git_repository *repository;
} php_git_tree_builder_t;
typedef struct{
zend_object zo;
git_repository *repository;
git_tree_entry *entry;
} php_git_tree_entry_t;
typedef struct{
zend_object zo;
git_tree *tree;
long offset;
git_repository *repository;
} php_git_tree_iterator_t;
typedef struct{
zend_object zo;
git_revwalk *walker;
} php_git_walker_t;
typedef struct{
git_odb_backend parent;
zval *self;
} php_git_backend_internal;
typedef struct{
zend_object zo;
php_git_backend_internal *backend;
} php_git_backend_t;
typedef struct{
zend_object zo;
git_signature *signature;
} php_git_signature_t;
typedef struct{
zend_object zo;
git_odb *odb;
} php_git_odb_t;
typedef struct{
zend_object zo;
git_index_entry *object;
} php_git_index_entry_t;
typedef struct{
zend_object zo;
git_object *object;
} php_git_object_t;
// extends git_object
typedef struct{
zend_object zo;
git_commit *object;
git_repository *repository;
} php_git_commit_t;
typedef struct{
zend_object zo;
git_tree *object;
git_repository *repository;
} php_git_tree_t;
typedef struct{
zend_object zo;
git_tag *object;
} php_git_tag_t;
enum php_git_blob_write_type{
PHP_GIT_LOAD_FROM_FILE,
PHP_GIT_LOAD_FROM_STRING
};
typedef struct{
zend_object zo;
git_blob *object;
git_repository *repository;
enum php_git_blob_write_type type;
char *contents;
int contents_len;
} php_git_blob_t;
typedef struct{
zend_object zo;
git_reference *object;
} php_git_reference_t;
typedef struct{
zend_object zo;
git_repository *repository;
} php_git_reference_manager_t;
typedef struct{
zend_object zo;
git_config *config;
} php_git_config_t;
#endif /* PHP_GIT_H */