|
| 1 | +/* |
| 2 | + * Copyright 2018 MongoDB, Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +#ifdef HAVE_CONFIG_H |
| 18 | +#include "config.h" |
| 19 | +#endif |
| 20 | + |
| 21 | +#include <php.h> |
| 22 | +#include <Zend/zend_interfaces.h> |
| 23 | + |
| 24 | +#include "phongo_compat.h" |
| 25 | +#include "php_phongo.h" |
| 26 | + |
| 27 | +zend_class_entry* php_phongo_cursor_interface_ce; |
| 28 | + |
| 29 | +/* {{{ MongoDB\BSON\CursorInterface function entries */ |
| 30 | +ZEND_BEGIN_ARG_INFO_EX(ai_CursorInterface_setTypeMap, 0, 0, 1) |
| 31 | + ZEND_ARG_ARRAY_INFO(0, typemap, 0) |
| 32 | +ZEND_END_ARG_INFO() |
| 33 | + |
| 34 | +ZEND_BEGIN_ARG_INFO_EX(ai_CursorInterface_void, 0, 0, 0) |
| 35 | +ZEND_END_ARG_INFO() |
| 36 | + |
| 37 | +static zend_function_entry php_phongo_cursor_interface_me[] = { |
| 38 | + /* clang-format off */ |
| 39 | + ZEND_ABSTRACT_ME(CursorInterface, getId, ai_CursorInterface_void) |
| 40 | + ZEND_ABSTRACT_ME(CursorInterface, getServer, ai_CursorInterface_void) |
| 41 | + ZEND_ABSTRACT_ME(CursorInterface, isDead, ai_CursorInterface_void) |
| 42 | + ZEND_ABSTRACT_ME(CursorInterface, setTypeMap, ai_CursorInterface_setTypeMap) |
| 43 | + ZEND_ABSTRACT_ME(CursorInterface, toArray, ai_CursorInterface_void) |
| 44 | + PHP_FE_END |
| 45 | + /* clang-format on */ |
| 46 | +}; |
| 47 | +/* }}} */ |
| 48 | + |
| 49 | +void php_phongo_cursor_interface_init_ce(INIT_FUNC_ARGS) /* {{{ */ |
| 50 | +{ |
| 51 | + zend_class_entry ce; |
| 52 | + |
| 53 | + INIT_NS_CLASS_ENTRY(ce, "MongoDB\\Driver", "CursorInterface", php_phongo_cursor_interface_me); |
| 54 | + php_phongo_cursor_interface_ce = zend_register_internal_interface(&ce TSRMLS_CC); |
| 55 | + |
| 56 | + zend_class_implements(php_phongo_cursor_interface_ce TSRMLS_CC, 1, zend_ce_traversable); |
| 57 | +} /* }}} */ |
| 58 | + |
| 59 | +/* |
| 60 | + * Local variables: |
| 61 | + * tab-width: 4 |
| 62 | + * c-basic-offset: 4 |
| 63 | + * End: |
| 64 | + * vim600: noet sw=4 ts=4 fdm=marker |
| 65 | + * vim<600: noet sw=4 ts=4 |
| 66 | + */ |
0 commit comments