21
21
22
22
#include "php_bson.h"
23
23
24
- #define PHONGO_ZEND_OBJECT_PRE
25
- #define PHONGO_ZEND_OBJECT_POST zend_object std;
26
- #define PHONGO_STRUCT_ZVAL zval
27
-
28
24
typedef struct {
29
- PHONGO_ZEND_OBJECT_PRE
30
25
mongoc_bulk_operation_t * bulk ;
31
26
size_t num_ops ;
32
27
bool ordered ;
33
28
int bypass ;
34
29
char * database ;
35
30
char * collection ;
36
31
bool executed ;
37
- PHONGO_ZEND_OBJECT_POST
32
+ zend_object std ;
38
33
} php_phongo_bulkwrite_t ;
39
34
40
35
typedef struct {
41
- PHONGO_ZEND_OBJECT_PRE
42
36
mongoc_client_encryption_t * client_encryption ;
43
- PHONGO_ZEND_OBJECT_POST
37
+ zend_object std ;
44
38
} php_phongo_clientencryption_t ;
45
39
46
40
typedef struct {
47
- PHONGO_ZEND_OBJECT_PRE
48
- bson_t * bson ;
49
- uint32_t max_await_time_ms ;
50
- uint32_t batch_size ;
51
- PHONGO_ZEND_OBJECT_POST
41
+ bson_t * bson ;
42
+ uint32_t max_await_time_ms ;
43
+ uint32_t batch_size ;
44
+ zend_object std ;
52
45
} php_phongo_command_t ;
53
46
54
47
typedef struct {
55
- PHONGO_ZEND_OBJECT_PRE
56
48
mongoc_cursor_t * cursor ;
57
49
mongoc_client_t * client ;
58
50
int created_by_pid ;
@@ -63,242 +55,211 @@ typedef struct {
63
55
long current ;
64
56
char * database ;
65
57
char * collection ;
66
- PHONGO_STRUCT_ZVAL query ;
67
- PHONGO_STRUCT_ZVAL command ;
68
- PHONGO_STRUCT_ZVAL read_preference ;
69
- PHONGO_STRUCT_ZVAL session ;
70
- PHONGO_ZEND_OBJECT_POST
58
+ zval query ;
59
+ zval command ;
60
+ zval read_preference ;
61
+ zval session ;
62
+ zend_object std ;
71
63
} php_phongo_cursor_t ;
72
64
73
65
typedef struct {
74
- PHONGO_ZEND_OBJECT_PRE
75
- int64_t id ;
76
- PHONGO_ZEND_OBJECT_POST
66
+ int64_t id ;
67
+ zend_object std ;
77
68
} php_phongo_cursorid_t ;
78
69
79
70
typedef struct {
80
- PHONGO_ZEND_OBJECT_PRE
81
71
mongoc_client_t * client ;
82
72
int created_by_pid ;
83
73
char * client_hash ;
84
74
size_t client_hash_len ;
85
- PHONGO_ZEND_OBJECT_POST
75
+ zend_object std ;
86
76
} php_phongo_manager_t ;
87
77
88
78
typedef struct {
89
- PHONGO_ZEND_OBJECT_PRE
90
79
bson_t * filter ;
91
80
bson_t * opts ;
92
81
mongoc_read_concern_t * read_concern ;
93
82
uint32_t max_await_time_ms ;
94
- PHONGO_ZEND_OBJECT_POST
83
+ zend_object std ;
95
84
} php_phongo_query_t ;
96
85
97
86
typedef struct {
98
- PHONGO_ZEND_OBJECT_PRE
99
87
mongoc_read_concern_t * read_concern ;
100
88
HashTable * properties ;
101
- PHONGO_ZEND_OBJECT_POST
89
+ zend_object std ;
102
90
} php_phongo_readconcern_t ;
103
91
104
92
typedef struct {
105
- PHONGO_ZEND_OBJECT_PRE
106
93
mongoc_read_prefs_t * read_preference ;
107
94
HashTable * properties ;
108
- PHONGO_ZEND_OBJECT_POST
95
+ zend_object std ;
109
96
} php_phongo_readpreference_t ;
110
97
111
98
typedef struct {
112
- PHONGO_ZEND_OBJECT_PRE
113
99
mongoc_client_t * client ;
114
100
int created_by_pid ;
115
101
uint32_t server_id ;
116
- PHONGO_ZEND_OBJECT_POST
102
+ zend_object std ;
117
103
} php_phongo_server_t ;
118
104
119
105
typedef struct {
120
- PHONGO_ZEND_OBJECT_PRE
121
106
mongoc_client_session_t * client_session ;
122
107
mongoc_client_t * client ;
123
108
int created_by_pid ;
124
- PHONGO_ZEND_OBJECT_POST
109
+ zend_object std ;
125
110
} php_phongo_session_t ;
126
111
127
112
typedef struct {
128
- PHONGO_ZEND_OBJECT_PRE
129
113
HashTable * properties ;
130
114
mongoc_write_concern_t * write_concern ;
131
- PHONGO_ZEND_OBJECT_POST
115
+ zend_object std ;
132
116
} php_phongo_writeconcern_t ;
133
117
134
118
typedef struct {
135
- PHONGO_ZEND_OBJECT_PRE
136
- int code ;
137
- char * message ;
138
- PHONGO_STRUCT_ZVAL info ;
139
- PHONGO_ZEND_OBJECT_POST
119
+ int code ;
120
+ char * message ;
121
+ zval info ;
122
+ zend_object std ;
140
123
} php_phongo_writeconcernerror_t ;
141
124
142
125
typedef struct {
143
- PHONGO_ZEND_OBJECT_PRE
144
- int code ;
145
- char * message ;
146
- PHONGO_STRUCT_ZVAL info ;
147
- uint32_t index ;
148
- PHONGO_ZEND_OBJECT_POST
126
+ int code ;
127
+ char * message ;
128
+ zval info ;
129
+ uint32_t index ;
130
+ zend_object std ;
149
131
} php_phongo_writeerror_t ;
150
132
151
133
typedef struct {
152
- PHONGO_ZEND_OBJECT_PRE
153
134
mongoc_write_concern_t * write_concern ;
154
135
bson_t * reply ;
155
136
mongoc_client_t * client ;
156
137
uint32_t server_id ;
157
- PHONGO_ZEND_OBJECT_POST
138
+ zend_object std ;
158
139
} php_phongo_writeresult_t ;
159
140
160
141
typedef struct {
161
- PHONGO_ZEND_OBJECT_PRE
162
- char * data ;
163
- int data_len ;
164
- uint8_t type ;
165
- HashTable * properties ;
166
- PHONGO_ZEND_OBJECT_POST
142
+ char * data ;
143
+ int data_len ;
144
+ uint8_t type ;
145
+ HashTable * properties ;
146
+ zend_object std ;
167
147
} php_phongo_binary_t ;
168
148
169
149
typedef struct {
170
- PHONGO_ZEND_OBJECT_PRE
171
- char * ref ;
172
- size_t ref_len ;
173
- char id [25 ];
174
- HashTable * properties ;
175
- PHONGO_ZEND_OBJECT_POST
150
+ char * ref ;
151
+ size_t ref_len ;
152
+ char id [25 ];
153
+ HashTable * properties ;
154
+ zend_object std ;
176
155
} php_phongo_dbpointer_t ;
177
156
178
157
typedef struct {
179
- PHONGO_ZEND_OBJECT_PRE
180
158
bool initialized ;
181
159
bson_decimal128_t decimal ;
182
160
HashTable * properties ;
183
- PHONGO_ZEND_OBJECT_POST
161
+ zend_object std ;
184
162
} php_phongo_decimal128_t ;
185
163
186
164
typedef struct {
187
- PHONGO_ZEND_OBJECT_PRE
188
- bool initialized ;
189
- int64_t integer ;
190
- HashTable * properties ;
191
- PHONGO_ZEND_OBJECT_POST
165
+ bool initialized ;
166
+ int64_t integer ;
167
+ HashTable * properties ;
168
+ zend_object std ;
192
169
} php_phongo_int64_t ;
193
170
194
171
typedef struct {
195
- PHONGO_ZEND_OBJECT_PRE
196
- char * code ;
197
- size_t code_len ;
198
- bson_t * scope ;
199
- HashTable * properties ;
200
- PHONGO_ZEND_OBJECT_POST
172
+ char * code ;
173
+ size_t code_len ;
174
+ bson_t * scope ;
175
+ HashTable * properties ;
176
+ zend_object std ;
201
177
} php_phongo_javascript_t ;
202
178
203
179
typedef struct {
204
- PHONGO_ZEND_OBJECT_PRE
205
- PHONGO_ZEND_OBJECT_POST
180
+ zend_object std ;
206
181
} php_phongo_maxkey_t ;
207
182
208
183
typedef struct {
209
- PHONGO_ZEND_OBJECT_PRE
210
- PHONGO_ZEND_OBJECT_POST
184
+ zend_object std ;
211
185
} php_phongo_minkey_t ;
212
186
213
187
typedef struct {
214
- PHONGO_ZEND_OBJECT_PRE
215
- bool initialized ;
216
- char oid [25 ];
217
- HashTable * properties ;
218
- PHONGO_ZEND_OBJECT_POST
188
+ bool initialized ;
189
+ char oid [25 ];
190
+ HashTable * properties ;
191
+ zend_object std ;
219
192
} php_phongo_objectid_t ;
220
193
221
194
typedef struct {
222
- PHONGO_ZEND_OBJECT_PRE
223
- char * pattern ;
224
- int pattern_len ;
225
- char * flags ;
226
- int flags_len ;
227
- HashTable * properties ;
228
- PHONGO_ZEND_OBJECT_POST
195
+ char * pattern ;
196
+ int pattern_len ;
197
+ char * flags ;
198
+ int flags_len ;
199
+ HashTable * properties ;
200
+ zend_object std ;
229
201
} php_phongo_regex_t ;
230
202
231
203
typedef struct {
232
- PHONGO_ZEND_OBJECT_PRE
233
- char * symbol ;
234
- size_t symbol_len ;
235
- HashTable * properties ;
236
- PHONGO_ZEND_OBJECT_POST
204
+ char * symbol ;
205
+ size_t symbol_len ;
206
+ HashTable * properties ;
207
+ zend_object std ;
237
208
} php_phongo_symbol_t ;
238
209
239
210
typedef struct {
240
- PHONGO_ZEND_OBJECT_PRE
241
- bool initialized ;
242
- uint32_t increment ;
243
- uint32_t timestamp ;
244
- HashTable * properties ;
245
- PHONGO_ZEND_OBJECT_POST
211
+ bool initialized ;
212
+ uint32_t increment ;
213
+ uint32_t timestamp ;
214
+ HashTable * properties ;
215
+ zend_object std ;
246
216
} php_phongo_timestamp_t ;
247
217
248
218
typedef struct {
249
- PHONGO_ZEND_OBJECT_PRE
250
- PHONGO_ZEND_OBJECT_POST
219
+ zend_object std ;
251
220
} php_phongo_undefined_t ;
252
221
253
222
typedef struct {
254
- PHONGO_ZEND_OBJECT_PRE
255
- bool initialized ;
256
- int64_t milliseconds ;
257
- HashTable * properties ;
258
- PHONGO_ZEND_OBJECT_POST
223
+ bool initialized ;
224
+ int64_t milliseconds ;
225
+ HashTable * properties ;
226
+ zend_object std ;
259
227
} php_phongo_utcdatetime_t ;
260
228
261
229
typedef struct {
262
- PHONGO_ZEND_OBJECT_PRE
263
- mongoc_client_t * client ;
264
- char * command_name ;
265
- uint32_t server_id ;
266
- uint64_t operation_id ;
267
- uint64_t request_id ;
268
- uint64_t duration_micros ;
269
- bson_t * reply ;
270
- PHONGO_STRUCT_ZVAL z_error ;
271
- PHONGO_ZEND_OBJECT_POST
230
+ mongoc_client_t * client ;
231
+ char * command_name ;
232
+ uint32_t server_id ;
233
+ uint64_t operation_id ;
234
+ uint64_t request_id ;
235
+ uint64_t duration_micros ;
236
+ bson_t * reply ;
237
+ zval z_error ;
238
+ zend_object std ;
272
239
} php_phongo_commandfailedevent_t ;
273
240
274
241
typedef struct {
275
- PHONGO_ZEND_OBJECT_PRE
276
242
mongoc_client_t * client ;
277
243
char * command_name ;
278
244
uint32_t server_id ;
279
245
uint64_t operation_id ;
280
246
uint64_t request_id ;
281
247
bson_t * command ;
282
248
char * database_name ;
283
- PHONGO_ZEND_OBJECT_POST
249
+ zend_object std ;
284
250
} php_phongo_commandstartedevent_t ;
285
251
286
252
typedef struct {
287
- PHONGO_ZEND_OBJECT_PRE
288
253
mongoc_client_t * client ;
289
254
char * command_name ;
290
255
uint32_t server_id ;
291
256
uint64_t operation_id ;
292
257
uint64_t request_id ;
293
258
uint64_t duration_micros ;
294
259
bson_t * reply ;
295
- PHONGO_ZEND_OBJECT_POST
260
+ zend_object std ;
296
261
} php_phongo_commandsucceededevent_t ;
297
262
298
- #undef PHONGO_ZEND_OBJECT_PRE
299
- #undef PHONGO_ZEND_OBJECT_POST
300
- #undef PHONGO_STRUCT_ZVAL
301
-
302
263
#endif /* PHONGO_STRUCTS */
303
264
304
265
/*
0 commit comments