This repository has been archived on 2020-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
ext-collections/src/php_collections.h

79 lines
2.3 KiB
C
Raw Normal View History

2018-03-21 08:21:28 +00:00
//
// ext-collections/php_collections.h
//
// @Author CismonX
//
#ifndef PHP_COLLECTIONS_H
#define PHP_COLLECTIONS_H
2018-09-08 05:07:29 +00:00
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
2018-09-07 08:00:08 +00:00
#include <php.h>
2018-03-21 08:21:28 +00:00
extern zend_module_entry collections_module_entry;
2018-08-22 08:35:27 +00:00
#define phpext_collections_ptr &collections_module_entry
2018-03-21 08:21:28 +00:00
2018-08-22 08:35:27 +00:00
#define PHP_COLLECTIONS_VERSION "0.1.0"
2018-03-21 08:21:28 +00:00
#ifdef PHP_WIN32
2018-08-22 08:35:27 +00:00
#define PHP_COLLECTIONS_API __declspec(dllexport)
2018-03-21 08:21:28 +00:00
#elif defined(__GNUC__) && __GNUC__ >= 4
2018-08-22 08:35:27 +00:00
#define PHP_COLLECTIONS_API __attribute__ ((visibility("default")))
2018-03-21 08:21:28 +00:00
#else
#define PHP_COLLECTIONS_API
#endif
2018-08-22 08:35:27 +00:00
#if PHP_VERSION_ID < 70100
#error "This extension requires PHP 7.1 and above."
#endif
2019-12-09 20:50:01 +00:00
#if PHP_VERSION_ID >= 70400
typedef zval* zobj_write_prop_ret_t;
#else
typedef void zobj_write_prop_ret_t;
#endif
2018-08-22 08:35:27 +00:00
#define PHP_COLLECTIONS_COMPARE_NATURAL (1 << 0)
#define PHP_COLLECTIONS_FOLD_CASE (1 << 1)
2018-08-20 14:47:23 +00:00
ZEND_BEGIN_MODULE_GLOBALS(collections)
zend_fcall_info* fci;
zend_fcall_info_cache* fcc;
2018-08-26 12:23:22 +00:00
zval* ref;
compare_func_t cmp;
ZEND_END_MODULE_GLOBALS(collections)
ZEND_EXTERN_MODULE_GLOBALS(collections)
#ifdef ZTS
#ifdef COMPILE_DL_COLLECTIONS
ZEND_TSRMLS_CACHE_EXTERN()
#endif
2018-08-22 08:35:27 +00:00
#define COLLECTIONS_G(v) TSRMG(collections_globals_id, zend_collections_globals*, v)
#else
2018-08-22 08:35:27 +00:00
#define COLLECTIONS_G(v) (collections_globals.v)
#endif
2018-03-23 09:06:05 +00:00
extern PHP_COLLECTIONS_API zend_class_entry* collections_collection_ce;
extern PHP_COLLECTIONS_API zend_class_entry* collections_pair_ce;
2018-08-09 08:33:39 +00:00
extern zend_object_handlers collection_handlers;
2018-10-11 10:53:39 +00:00
int collection_count_elements(zval* obj, zend_long* count);
int collection_has_dimension(zval* object, zval* offset, int check_empty);
void collection_write_dimension(zval* object, zval* offset, zval* value);
zval* collection_read_dimension(zval* object, zval* offset, int type, zval* rv);
void collection_unset_dimension(zval* object, zval* offset);
int collection_has_property(zval* object, zval* member, int has_set_exists, void**);
2019-12-09 20:50:01 +00:00
zobj_write_prop_ret_t collection_write_property(zval* object, zval* member, zval* value, void**);
2018-10-11 10:53:39 +00:00
zval* collection_read_property(zval* object, zval* member, int type, void**, zval* rv);
void collection_unset_property(zval* object, zval* member, void**);
2018-03-23 09:06:05 +00:00
extern const zend_function_entry collection_methods[];
extern const zend_function_entry pair_methods[];
2018-08-22 08:35:27 +00:00
#endif // !PHP_COLLECTIONS_H