芝麻web文件管理V1.00
编辑当前文件:/home/conskgoa/doughi.co.uk/include.zip
PK "\:y' ' php/ext/libxml/php_libxml.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Shane Caraveo
| | Wez Furlong
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_LIBXML_H #define PHP_LIBXML_H #if HAVE_LIBXML extern zend_module_entry libxml_module_entry; #define libxml_module_ptr &libxml_module_entry #include "php_version.h" #define PHP_LIBXML_VERSION PHP_VERSION #ifdef PHP_WIN32 # define PHP_LIBXML_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_LIBXML_API __attribute__ ((visibility("default"))) #else # define PHP_LIBXML_API #endif #include "zend_smart_str.h" #include
#define LIBXML_SAVE_NOEMPTYTAG 1<<2 ZEND_BEGIN_MODULE_GLOBALS(libxml) zval stream_context; smart_str error_buffer; zend_llist *error_list; struct _php_libxml_entity_resolver { zval object; zend_fcall_info fci; zend_fcall_info_cache fcc; } entity_loader; zend_bool entity_loader_disabled; ZEND_END_MODULE_GLOBALS(libxml) typedef struct _libxml_doc_props { int formatoutput; int validateonparse; int resolveexternals; int preservewhitespace; int substituteentities; int stricterror; int recover; HashTable *classmap; } libxml_doc_props; typedef struct _php_libxml_ref_obj { void *ptr; int refcount; libxml_doc_props *doc_props; } php_libxml_ref_obj; typedef struct _php_libxml_node_ptr { xmlNodePtr node; int refcount; void *_private; } php_libxml_node_ptr; typedef struct _php_libxml_node_object { php_libxml_node_ptr *node; php_libxml_ref_obj *document; HashTable *properties; zend_object std; } php_libxml_node_object; static inline php_libxml_node_object *php_libxml_node_fetch_object(zend_object *obj) { return (php_libxml_node_object *)((char*)(obj) - obj->handlers->offset); } #define Z_LIBXML_NODE_P(zv) php_libxml_node_fetch_object(Z_OBJ_P((zv))) typedef void * (*php_libxml_export_node) (zval *object); PHP_LIBXML_API int php_libxml_increment_node_ptr(php_libxml_node_object *object, xmlNodePtr node, void *private_data); PHP_LIBXML_API int php_libxml_decrement_node_ptr(php_libxml_node_object *object); PHP_LIBXML_API int php_libxml_increment_doc_ref(php_libxml_node_object *object, xmlDocPtr docp); PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object); PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object); PHP_LIBXML_API zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function); /* When an explicit freeing of node and children is required */ PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node); PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node); /* When object dtor is called as node may still be referenced */ PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object); PHP_LIBXML_API void php_libxml_error_handler(void *ctx, const char *msg, ...); PHP_LIBXML_API void php_libxml_ctx_warning(void *ctx, const char *msg, ...); PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...); PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s); PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext); PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg); PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable); /* Init/shutdown functions*/ PHP_LIBXML_API void php_libxml_initialize(void); PHP_LIBXML_API void php_libxml_shutdown(void); #define LIBXML(v) ZEND_MODULE_GLOBALS_ACCESSOR(libxml, v) #if defined(ZTS) && defined(COMPILE_DL_LIBXML) ZEND_TSRMLS_CACHE_EXTERN() #endif /* Other extension may override the global state options, these global options * are copied initially to ctxt->options. Set the options to a known good value. * See libxml2 globals.c and parserInternals.c. * The unique_name argument allows multiple sanitizes and restores within the * same function, even nested is necessary. */ #define PHP_LIBXML_SANITIZE_GLOBALS(unique_name) \ int xml_old_loadsubset_##unique_name = xmlLoadExtDtdDefaultValue; \ xmlLoadExtDtdDefaultValue = 0; \ int xml_old_validate_##unique_name = xmlDoValidityCheckingDefaultValue; \ xmlDoValidityCheckingDefaultValue = 0; \ int xml_old_pedantic_##unique_name = xmlPedanticParserDefault(0); \ int xml_old_substitute_##unique_name = xmlSubstituteEntitiesDefault(0); \ int xml_old_linenrs_##unique_name = xmlLineNumbersDefault(0); \ int xml_old_blanks_##unique_name = xmlKeepBlanksDefault(1); #define PHP_LIBXML_RESTORE_GLOBALS(unique_name) \ xmlLoadExtDtdDefaultValue = xml_old_loadsubset_##unique_name; \ xmlDoValidityCheckingDefaultValue = xml_old_validate_##unique_name; \ (void) xmlPedanticParserDefault(xml_old_pedantic_##unique_name); \ (void) xmlSubstituteEntitiesDefault(xml_old_substitute_##unique_name); \ (void) xmlLineNumbersDefault(xml_old_linenrs_##unique_name); \ (void) xmlKeepBlanksDefault(xml_old_blanks_##unique_name); /* Alternative for above, working directly on the context and not setting globals. * Generally faster because no locking is involved, and this has the advantage that it sets the options to a known good value. */ static zend_always_inline void php_libxml_sanitize_parse_ctxt_options(xmlParserCtxtPtr ctxt) { ctxt->loadsubset = 0; ctxt->validate = 0; ctxt->pedantic = 0; ctxt->replaceEntities = 0; ctxt->linenumbers = 0; ctxt->keepBlanks = 1; ctxt->options = 0; } #else /* HAVE_LIBXML */ #define libxml_module_ptr NULL #endif #define phpext_libxml_ptr libxml_module_ptr #endif /* PHP_LIBXML_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ PK "\B8 ) php/ext/simplexml/php_simplexml_exports.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sterling Hughes
| | Marcus Boerger
| | Rob Richards
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_SIMPLEXML_EXPORTS_H #define PHP_SIMPLEXML_EXPORTS_H #include "php_simplexml.h" #define SKIP_TEXT(__p) \ if ((__p)->type == XML_TEXT_NODE) { \ goto next_iter; \ } #define GET_NODE(__s, __n) { \ if ((__s)->node && (__s)->node->node) { \ __n = (__s)->node->node; \ } else { \ __n = NULL; \ php_error_docref(NULL, E_WARNING, "Node no longer exists"); \ } \ } PHP_SXE_API zend_object *sxe_object_new(zend_class_entry *ce); static inline php_sxe_object *php_sxe_fetch_object(zend_object *obj) /* {{{ */ { return (php_sxe_object *)((char*)(obj) - XtOffsetOf(php_sxe_object, zo)); } /* }}} */ #define Z_SXEOBJ_P(zv) php_sxe_fetch_object(Z_OBJ_P((zv))) typedef struct { zend_object_iterator intern; php_sxe_object *sxe; } php_sxe_iterator; #endif /* PHP_SIMPLEXML_EXPORTS_H */ /** * Local Variables: * c-basic-offset: 4 * tab-width: 4 * indent-tabs-mode: t * End: * vim600: fdm=marker * vim: noet sw=4 ts=4 */ PK "\ D D ! php/ext/simplexml/php_simplexml.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sterling Hughes
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_SIMPLEXML_H #define PHP_SIMPLEXML_H extern zend_module_entry simplexml_module_entry; #define phpext_simplexml_ptr &simplexml_module_entry #include "php_version.h" #define PHP_SIMPLEXML_VERSION PHP_VERSION #ifdef ZTS #include "TSRM.h" #endif #include "ext/libxml/php_libxml.h" #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
PHP_MINIT_FUNCTION(simplexml); PHP_MSHUTDOWN_FUNCTION(simplexml); PHP_MINFO_FUNCTION(simplexml); typedef enum { SXE_ITER_NONE = 0, SXE_ITER_ELEMENT = 1, SXE_ITER_CHILD = 2, SXE_ITER_ATTRLIST = 3 } SXE_ITER; typedef struct { php_libxml_node_ptr *node; php_libxml_ref_obj *document; HashTable *properties; xmlXPathContextPtr xpath; struct { xmlChar *name; xmlChar *nsprefix; int isprefix; SXE_ITER type; zval data; } iter; zval tmp; zend_function *fptr_count; zend_object zo; } php_sxe_object; #ifdef ZTS #define SIMPLEXML_G(v) TSRMG(simplexml_globals_id, zend_simplexml_globals *, v) #else #define SIMPLEXML_G(v) (simplexml_globals.v) #endif #ifdef PHP_WIN32 # ifdef PHP_SIMPLEXML_EXPORTS # define PHP_SXE_API __declspec(dllexport) # else # define PHP_SXE_API __declspec(dllimport) # endif #else # define PHP_SXE_API ZEND_API #endif PHP_SXE_API zend_class_entry *sxe_get_element_class_entry(); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: t * End: * vim600: fdm=marker * vim: noet sw=4 ts=4 */ PK "\E-6J J php/ext/hash/php_hash_sha.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | SHA1 Author: Stefan Esser
| | SHA256 Author: Sara Golemon
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_SHA_H #define PHP_HASH_SHA_H /* When SHA is removed from Core, the ext/standard/sha1.c file can be removed and the ext/standard/sha1.h file can be reduced to: #define PHP_HASH_SHA1_NOT_IN_CORE #include "ext/hash/php_hash_sha.h" Don't forget to remove sha1() and sha1_file() from basic_functions.c */ #include "ext/standard/sha1.h" #include "ext/standard/basic_functions.h" #ifdef PHP_HASH_SHA1_NOT_IN_CORE /* SHA1 context. */ typedef struct { uint32_t state[5]; /* state (ABCD) */ uint32_t count[2]; /* number of bits, modulo 2^64 */ unsigned char buffer[64]; /* input buffer */ } PHP_SHA1_CTX; PHP_HASH_API void PHP_SHA1Init(PHP_SHA1_CTX *); PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_SHA1Final(unsigned char[20], PHP_SHA1_CTX *); PHP_FUNCTION(sha1); PHP_FUNCTION(sha1_file); #endif /* PHP_HASH_SHA1_NOT_IN_CORE */ /* SHA224 context. */ typedef struct { uint32_t state[8]; /* state */ uint32_t count[2]; /* number of bits, modulo 2^64 */ unsigned char buffer[64]; /* input buffer */ } PHP_SHA224_CTX; PHP_HASH_API void PHP_SHA224Init(PHP_SHA224_CTX *); PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_SHA224Final(unsigned char[28], PHP_SHA224_CTX *); /* SHA256 context. */ typedef struct { uint32_t state[8]; /* state */ uint32_t count[2]; /* number of bits, modulo 2^64 */ unsigned char buffer[64]; /* input buffer */ } PHP_SHA256_CTX; PHP_HASH_API void PHP_SHA256Init(PHP_SHA256_CTX *); PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_SHA256Final(unsigned char[32], PHP_SHA256_CTX *); /* SHA384 context */ typedef struct { uint64_t state[8]; /* state */ uint64_t count[2]; /* number of bits, modulo 2^128 */ unsigned char buffer[128]; /* input buffer */ } PHP_SHA384_CTX; PHP_HASH_API void PHP_SHA384Init(PHP_SHA384_CTX *); PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_SHA384Final(unsigned char[48], PHP_SHA384_CTX *); /* SHA512 context */ typedef struct { uint64_t state[8]; /* state */ uint64_t count[2]; /* number of bits, modulo 2^128 */ unsigned char buffer[128]; /* input buffer */ } PHP_SHA512_CTX; PHP_HASH_API void PHP_SHA512Init(PHP_SHA512_CTX *); PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_SHA512Final(unsigned char[64], PHP_SHA512_CTX *); PHP_HASH_API void PHP_SHA512_256Init(PHP_SHA512_CTX *); #define PHP_SHA512_256Update PHP_SHA512Update PHP_HASH_API void PHP_SHA512_256Final(unsigned char[32], PHP_SHA512_CTX *); PHP_HASH_API void PHP_SHA512_224Init(PHP_SHA512_CTX *); #define PHP_SHA512_224Update PHP_SHA512Update PHP_HASH_API void PHP_SHA512_224Final(unsigned char[28], PHP_SHA512_CTX *); #endif /* PHP_HASH_SHA_H */ PK "\C php/ext/hash/php_hash_md.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Original Author: Rasmus Lerdorf
| | Modified for pHASH by: Sara Golemon
+----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_MD_H #define PHP_HASH_MD_H /* When SHA is removed from Core, the ext/standard/sha1.c file can be removed and the ext/standard/sha1.h file can be reduced to: #define PHP_HASH_SHA1_NOT_IN_CORE #include "ext/hash/php_hash_sha.h" Don't forget to remove md5() and md5_file() entries from basic_functions.c */ #include "ext/standard/md5.h" #ifdef PHP_HASH_MD5_NOT_IN_CORE /* MD5.H - header file for MD5C.C */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* MD5 context. */ typedef struct { uint32_t state[4]; /* state (ABCD) */ uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } PHP_MD5_CTX; PHP_HASH_API void make_digest(char *md5str, unsigned char *digest); PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX *); PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_MD5Final(unsigned char[16], PHP_MD5_CTX *); PHP_NAMED_FUNCTION(php_if_md5); PHP_NAMED_FUNCTION(php_if_md5_file); #endif /* PHP_HASH_MD5_NOT_IN_CORE */ /* MD4 context */ typedef struct { uint32_t state[4]; uint32_t count[2]; unsigned char buffer[64]; } PHP_MD4_CTX; PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX *); PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *, unsigned int); PHP_HASH_API void PHP_MD4Final(unsigned char[16], PHP_MD4_CTX *); /* MD2 context */ typedef struct { unsigned char state[48]; unsigned char checksum[16]; unsigned char buffer[16]; char in_buffer; } PHP_MD2_CTX; PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context); PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *, unsigned int); PHP_HASH_API void PHP_MD2Final(unsigned char[16], PHP_MD2_CTX *); #endif PK "\ php/ext/hash/php_hash_adler32.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Michael Wallner
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_ADLER32_H #define PHP_HASH_ADLER32_H #include "ext/standard/basic_functions.h" typedef struct { uint32_t state; } PHP_ADLER32_CTX; PHP_HASH_API void PHP_ADLER32Init(PHP_ADLER32_CTX *context); PHP_HASH_API void PHP_ADLER32Update(PHP_ADLER32_CTX *context, const unsigned char *input, size_t len); PHP_HASH_API void PHP_ADLER32Final(unsigned char digest[4], PHP_ADLER32_CTX *context); PHP_HASH_API int PHP_ADLER32Copy(const php_hash_ops *ops, PHP_ADLER32_CTX *orig_context, PHP_ADLER32_CTX *copy_context); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK "\?s php/ext/hash/php_hash_joaat.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Martin Jansen
| +----------------------------------------------------------------------+ */ /* $Id*/ #ifndef PHP_HASH_JOAAT_H #define PHP_HASH_JOAAT_H typedef struct { uint32_t state; } PHP_JOAAT_CTX; PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context); PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, unsigned int inputLen); PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[16], PHP_JOAAT_CTX * context); static uint32_t joaat_buf(void *buf, size_t len, uint32_t hval); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\hV php/ext/hash/php_hash_gost.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Michael Wallner
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_GOST_H #define PHP_HASH_GOST_H #include "ext/standard/basic_functions.h" /* GOST context */ typedef struct { uint32_t state[16]; uint32_t count[2]; unsigned char length; unsigned char buffer[32]; const uint32_t (*tables)[4][256]; } PHP_GOST_CTX; PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *); PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_GOSTFinal(unsigned char[64], PHP_GOST_CTX *); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK "\ı ! php/ext/hash/php_hash_whirlpool.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Michael Wallner
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_WHIRLPOOL_H #define PHP_HASH_WHIRLPOOL_H /* WHIRLPOOL context */ typedef struct { uint64_t state[8]; unsigned char bitlength[32]; struct { int pos; int bits; unsigned char data[64]; } buffer; } PHP_WHIRLPOOL_CTX; PHP_HASH_API void PHP_WHIRLPOOLInit(PHP_WHIRLPOOL_CTX *); PHP_HASH_API void PHP_WHIRLPOOLUpdate(PHP_WHIRLPOOL_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_WHIRLPOOLFinal(unsigned char[64], PHP_WHIRLPOOL_CTX *); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK "\ php/ext/hash/php_hash_haval.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sara Golemon
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_HAVAL_H #define PHP_HASH_HAVAL_H #include "ext/standard/basic_functions.h" /* HAVAL context. */ typedef struct { uint32_t state[8]; uint32_t count[2]; unsigned char buffer[128]; char passes; short output; void (*Transform)(uint32_t state[8], const unsigned char block[128]); } PHP_HAVAL_CTX; #define PHP_HASH_HAVAL_INIT_DECL(p,b) PHP_HASH_API void PHP_##p##HAVAL##b##Init(PHP_HAVAL_CTX *); \ PHP_HASH_API void PHP_HAVAL##b##Final(unsigned char*, PHP_HAVAL_CTX *); PHP_HASH_API void PHP_HAVALUpdate(PHP_HAVAL_CTX *, const unsigned char *, unsigned int); PHP_HASH_HAVAL_INIT_DECL(3,128) PHP_HASH_HAVAL_INIT_DECL(3,160) PHP_HASH_HAVAL_INIT_DECL(3,192) PHP_HASH_HAVAL_INIT_DECL(3,224) PHP_HASH_HAVAL_INIT_DECL(3,256) PHP_HASH_HAVAL_INIT_DECL(4,128) PHP_HASH_HAVAL_INIT_DECL(4,160) PHP_HASH_HAVAL_INIT_DECL(4,192) PHP_HASH_HAVAL_INIT_DECL(4,224) PHP_HASH_HAVAL_INIT_DECL(4,256) PHP_HASH_HAVAL_INIT_DECL(5,128) PHP_HASH_HAVAL_INIT_DECL(5,160) PHP_HASH_HAVAL_INIT_DECL(5,192) PHP_HASH_HAVAL_INIT_DECL(5,224) PHP_HASH_HAVAL_INIT_DECL(5,256) #endif PK "\W php/ext/hash/php_hash_tiger.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Michael Wallner
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_TIGER_H #define PHP_HASH_TIGER_H /* TIGER context */ typedef struct { uint64_t state[3]; uint64_t passed; unsigned char buffer[64]; unsigned int passes:1; unsigned int length:7; } PHP_TIGER_CTX; PHP_HASH_API void PHP_3TIGERInit(PHP_TIGER_CTX *context); PHP_HASH_API void PHP_4TIGERInit(PHP_TIGER_CTX *context); PHP_HASH_API void PHP_TIGERUpdate(PHP_TIGER_CTX *context, const unsigned char *input, size_t len); PHP_HASH_API void PHP_TIGER128Final(unsigned char digest[16], PHP_TIGER_CTX *context); PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX *context); PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *context); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK "\; к php/ext/hash/php_hash_sha3.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sara Golemon
| +----------------------------------------------------------------------+ */ #ifndef PHP_HASH_SHA3_H #define PHP_HASH_SHA3_H #include "php.h" typedef struct { unsigned char state[200]; // 5 * 5 * sizeof(uint64) uint32_t pos; } PHP_SHA3_CTX; typedef PHP_SHA3_CTX PHP_SHA3_224_CTX; typedef PHP_SHA3_CTX PHP_SHA3_256_CTX; typedef PHP_SHA3_CTX PHP_SHA3_384_CTX; typedef PHP_SHA3_CTX PHP_SHA3_512_CTX; PHP_HASH_API void PHP_SHA3224Init(PHP_SHA3_224_CTX*); PHP_HASH_API void PHP_SHA3224Update(PHP_SHA3_224_CTX*, const unsigned char*, unsigned int); PHP_HASH_API void PHP_SAH3224Final(unsigned char[32], PHP_SHA3_224_CTX*); PHP_HASH_API void PHP_SHA3256Init(PHP_SHA3_256_CTX*); PHP_HASH_API void PHP_SHA3256Update(PHP_SHA3_256_CTX*, const unsigned char*, unsigned int); PHP_HASH_API void PHP_SAH3256Final(unsigned char[32], PHP_SHA3_256_CTX*); PHP_HASH_API void PHP_SHA3384Init(PHP_SHA3_384_CTX*); PHP_HASH_API void PHP_SHA3384Update(PHP_SHA3_384_CTX*, const unsigned char*, unsigned int); PHP_HASH_API void PHP_SAH3384Final(unsigned char[32], PHP_SHA3_384_CTX*); PHP_HASH_API void PHP_SHA3512Init(PHP_SHA3_512_CTX*); PHP_HASH_API void PHP_SHA3512Update(PHP_SHA3_512_CTX*, const unsigned char*, unsigned int); PHP_HASH_API void PHP_SAH3512Final(unsigned char[32], PHP_SHA3_512_CTX*); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK "\o.1 1 php/ext/hash/php_hash_snefru.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Michael Wallner
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_SNEFRU_H #define PHP_HASH_SNEFRU_H /* SNEFRU-2.5a with 8 passes and 256 bit hash output * AKA "Xerox Secure Hash Function" */ #include "ext/standard/basic_functions.h" /* SNEFRU context */ typedef struct { uint32_t state[16]; uint32_t count[2]; unsigned char length; unsigned char buffer[32]; } PHP_SNEFRU_CTX; PHP_HASH_API void PHP_SNEFRUInit(PHP_SNEFRU_CTX *); PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *, const unsigned char *, size_t); PHP_HASH_API void PHP_SNEFRUFinal(unsigned char[32], PHP_SNEFRU_CTX *); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK "\'9 php/ext/hash/php_hash_ripemd.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sara Golemon
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_RIPEMD_H #define PHP_HASH_RIPEMD_H #include "ext/standard/basic_functions.h" /* RIPEMD context. */ typedef struct { uint32_t state[4]; /* state (ABCD) */ uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } PHP_RIPEMD128_CTX; typedef struct { uint32_t state[5]; /* state (ABCD) */ uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } PHP_RIPEMD160_CTX; typedef struct { uint32_t state[8]; /* state (ABCD) */ uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } PHP_RIPEMD256_CTX; typedef struct { uint32_t state[10]; /* state (ABCD) */ uint32_t count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ } PHP_RIPEMD320_CTX; PHP_HASH_API void PHP_RIPEMD128Init(PHP_RIPEMD128_CTX *); PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_RIPEMD128Final(unsigned char[16], PHP_RIPEMD128_CTX *); PHP_HASH_API void PHP_RIPEMD160Init(PHP_RIPEMD160_CTX *); PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_RIPEMD160Final(unsigned char[20], PHP_RIPEMD160_CTX *); PHP_HASH_API void PHP_RIPEMD256Init(PHP_RIPEMD256_CTX *); PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_RIPEMD256Final(unsigned char[32], PHP_RIPEMD256_CTX *); PHP_HASH_API void PHP_RIPEMD320Init(PHP_RIPEMD320_CTX *); PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX *, const unsigned char *, unsigned int); PHP_HASH_API void PHP_RIPEMD320Final(unsigned char[40], PHP_RIPEMD320_CTX *); #endif /* PHP_HASH_RIPEMD_H */ PK "\Mμ php/ext/hash/php_hash_fnv.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Michael Maclean
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_FNV_H #define PHP_HASH_FNV_H #define PHP_FNV1_32_INIT ((uint32_t)0x811c9dc5) #define PHP_FNV1_32A_INIT PHP_FNV1_32_INIT #define PHP_FNV_32_PRIME ((uint32_t)0x01000193) #define PHP_FNV1_64_INIT ((uint64_t)0xcbf29ce484222325ULL) #define PHP_FNV1A_64_INIT FNV1_64_INIT #define PHP_FNV_64_PRIME ((uint64_t)0x100000001b3ULL) /* * hash types */ enum php_fnv_type { PHP_FNV_NONE = 0, /* invalid FNV hash type */ PHP_FNV0_32 = 1, /* FNV-0 32 bit hash */ PHP_FNV1_32 = 2, /* FNV-1 32 bit hash */ PHP_FNV1a_32 = 3, /* FNV-1a 32 bit hash */ PHP_FNV0_64 = 4, /* FNV-0 64 bit hash */ PHP_FNV1_64 = 5, /* FNV-1 64 bit hash */ PHP_FNV1a_64 = 6, /* FNV-1a 64 bit hash */ }; typedef struct { uint32_t state; } PHP_FNV132_CTX; typedef struct { uint64_t state; } PHP_FNV164_CTX; PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context); PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, unsigned int inputLen); PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, unsigned int inputLen); PHP_HASH_API void PHP_FNV132Final(unsigned char digest[16], PHP_FNV132_CTX * context); PHP_HASH_API void PHP_FNV164Init(PHP_FNV164_CTX *context); PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, unsigned int inputLen); PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, unsigned int inputLen); PHP_HASH_API void PHP_FNV164Final(unsigned char digest[16], PHP_FNV164_CTX * context); static uint32_t fnv_32_buf(void *buf, size_t len, uint32_t hval, int alternate); static uint64_t fnv_64_buf(void *buf, size_t len, uint64_t hval, int alternate); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\Yf f php/ext/hash/php_hash_crc32.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Michael Wallner
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_CRC32_H #define PHP_HASH_CRC32_H #include "ext/standard/basic_functions.h" typedef struct { uint32_t state; } PHP_CRC32_CTX; PHP_HASH_API void PHP_CRC32Init(PHP_CRC32_CTX *context); PHP_HASH_API void PHP_CRC32Update(PHP_CRC32_CTX *context, const unsigned char *input, size_t len); PHP_HASH_API void PHP_CRC32BUpdate(PHP_CRC32_CTX *context, const unsigned char *input, size_t len); PHP_HASH_API void PHP_CRC32Final(unsigned char digest[4], PHP_CRC32_CTX *context); PHP_HASH_API int PHP_CRC32Copy(const php_hash_ops *ops, PHP_CRC32_CTX *orig_context, PHP_CRC32_CTX *copy_context); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ PK "\2- - php/ext/hash/php_hash.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sara Golemon
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_HASH_H #define PHP_HASH_H #include "php.h" #define PHP_HASH_EXTNAME "hash" #define PHP_HASH_VERSION "1.0" #define PHP_MHASH_VERSION "1.0" #define PHP_HASH_RESNAME "Hash Context" #define PHP_HASH_HMAC 0x0001 #define L64 INT64_C typedef void (*php_hash_init_func_t)(void *context); typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count); typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context); typedef int (*php_hash_copy_func_t)(const void *ops, void *orig_context, void *dest_context); typedef struct _php_hash_ops { php_hash_init_func_t hash_init; php_hash_update_func_t hash_update; php_hash_final_func_t hash_final; php_hash_copy_func_t hash_copy; int digest_size; int block_size; int context_size; } php_hash_ops; typedef struct _php_hash_data { const php_hash_ops *ops; void *context; zend_long options; unsigned char *key; } php_hash_data; extern const php_hash_ops php_hash_md2_ops; extern const php_hash_ops php_hash_md4_ops; extern const php_hash_ops php_hash_md5_ops; extern const php_hash_ops php_hash_sha1_ops; extern const php_hash_ops php_hash_sha224_ops; extern const php_hash_ops php_hash_sha256_ops; extern const php_hash_ops php_hash_sha384_ops; extern const php_hash_ops php_hash_sha512_ops; extern const php_hash_ops php_hash_sha512_256_ops; extern const php_hash_ops php_hash_sha512_224_ops; extern const php_hash_ops php_hash_sha3_224_ops; extern const php_hash_ops php_hash_sha3_256_ops; extern const php_hash_ops php_hash_sha3_384_ops; extern const php_hash_ops php_hash_sha3_512_ops; extern const php_hash_ops php_hash_ripemd128_ops; extern const php_hash_ops php_hash_ripemd160_ops; extern const php_hash_ops php_hash_ripemd256_ops; extern const php_hash_ops php_hash_ripemd320_ops; extern const php_hash_ops php_hash_whirlpool_ops; extern const php_hash_ops php_hash_3tiger128_ops; extern const php_hash_ops php_hash_3tiger160_ops; extern const php_hash_ops php_hash_3tiger192_ops; extern const php_hash_ops php_hash_4tiger128_ops; extern const php_hash_ops php_hash_4tiger160_ops; extern const php_hash_ops php_hash_4tiger192_ops; extern const php_hash_ops php_hash_snefru_ops; extern const php_hash_ops php_hash_gost_ops; extern const php_hash_ops php_hash_gost_crypto_ops; extern const php_hash_ops php_hash_adler32_ops; extern const php_hash_ops php_hash_crc32_ops; extern const php_hash_ops php_hash_crc32b_ops; extern const php_hash_ops php_hash_fnv132_ops; extern const php_hash_ops php_hash_fnv1a32_ops; extern const php_hash_ops php_hash_fnv164_ops; extern const php_hash_ops php_hash_fnv1a64_ops; extern const php_hash_ops php_hash_joaat_ops; #define PHP_HASH_HAVAL_OPS(p,b) extern const php_hash_ops php_hash_##p##haval##b##_ops; PHP_HASH_HAVAL_OPS(3,128) PHP_HASH_HAVAL_OPS(3,160) PHP_HASH_HAVAL_OPS(3,192) PHP_HASH_HAVAL_OPS(3,224) PHP_HASH_HAVAL_OPS(3,256) PHP_HASH_HAVAL_OPS(4,128) PHP_HASH_HAVAL_OPS(4,160) PHP_HASH_HAVAL_OPS(4,192) PHP_HASH_HAVAL_OPS(4,224) PHP_HASH_HAVAL_OPS(4,256) PHP_HASH_HAVAL_OPS(5,128) PHP_HASH_HAVAL_OPS(5,160) PHP_HASH_HAVAL_OPS(5,192) PHP_HASH_HAVAL_OPS(5,224) PHP_HASH_HAVAL_OPS(5,256) extern zend_module_entry hash_module_entry; #define phpext_hash_ptr &hash_module_entry #ifdef PHP_WIN32 # define PHP_HASH_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_HASH_API __attribute__ ((visibility("default"))) #else # define PHP_HASH_API #endif #ifdef ZTS #include "TSRM.h" #endif PHP_FUNCTION(hash); PHP_FUNCTION(hash_file); PHP_FUNCTION(hash_hkdf); PHP_FUNCTION(hash_hmac); PHP_FUNCTION(hash_hmac_file); PHP_FUNCTION(hash_init); PHP_FUNCTION(hash_update); PHP_FUNCTION(hash_update_stream); PHP_FUNCTION(hash_update_file); PHP_FUNCTION(hash_final); PHP_FUNCTION(hash_algos); PHP_FUNCTION(hash_pbkdf2); PHP_FUNCTION(hash_equals); PHP_HASH_API const php_hash_ops *php_hash_fetch_ops(const char *algo, size_t algo_len); PHP_HASH_API void php_hash_register_algo(const char *algo, const php_hash_ops *ops); PHP_HASH_API int php_hash_copy(const void *ops, void *orig_context, void *dest_context); static inline void php_hash_bin2hex(char *out, const unsigned char *in, int in_len) { static const char hexits[17] = "0123456789abcdef"; int i; for(i = 0; i < in_len; i++) { out[i * 2] = hexits[in[i] >> 4]; out[(i * 2) + 1] = hexits[in[i] & 0x0F]; } } #endif /* PHP_HASH_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\>k php/ext/phar/php_phar.hnu [ /* +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ | Copyright (c) 2005-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Gregory Beaver
| | Marcus Boerger
| +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_PHAR_H #define PHP_PHAR_H #define PHP_PHAR_VERSION "2.0.2" #include "ext/standard/basic_functions.h" extern zend_module_entry phar_module_entry; #define phpext_phar_ptr &phar_module_entry #ifdef PHP_WIN32 #define PHP_PHAR_API __declspec(dllexport) #else #define PHP_PHAR_API PHPAPI #endif PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len); #endif /* PHP_PHAR_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\UUQ Q php/ext/apcu/apc_lock.hnu [ /* +----------------------------------------------------------------------+ | APCu | +----------------------------------------------------------------------+ | Copyright (c) 2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Joe Watkins
| +----------------------------------------------------------------------+ */ #ifndef APC_LOCK_H #define APC_LOCK_H /* APCu works most efficiently where there is access to native read/write locks If the current system has native rwlocks present they will be used, if they are not present, APCu will emulate their behavior with standard mutex. While APCu is emulating read/write locks, reads and writes are exclusive, additionally the write lock prefers readers, as is the default behaviour of the majority of Posix rwlock implementations */ #ifdef HAVE_CONFIG_H # include
#endif #include "apc.h" #ifndef PHP_WIN32 # ifndef __USE_UNIX98 # define __USE_UNIX98 # endif # include "pthread.h" # ifndef APC_SPIN_LOCK # ifndef APC_FCNTL_LOCK # ifdef APC_NATIVE_RWLOCK typedef pthread_rwlock_t apc_lock_t; # define APC_LOCK_SHARED # else typedef pthread_mutex_t apc_lock_t; # define APC_LOCK_RECURSIVE # endif # else typedef int apc_lock_t; # define APC_LOCK_FILE # endif # else # define APC_LOCK_NICE 1 typedef struct { unsigned long state; } apc_lock_t; # endif #else /* XXX kernel lock mode only for now, compatible through all the wins, add more ifdefs for others */ # include "apc_windows_srwlock_kernel.h" typedef apc_windows_cs_rwlock_t apc_lock_t; # define APC_LOCK_SHARED #endif /* {{{ functions */ /* The following functions should be called once per process: apc_lock_init initializes attributes suitable for all locks apc_lock_cleanup destroys those attributes This saves us from having to create and destroy attributes for every lock we use at runtime */ PHP_APCU_API zend_bool apc_lock_init(void); PHP_APCU_API void apc_lock_cleanup(void); /* The following functions should be self explanitory: */ PHP_APCU_API zend_bool apc_lock_create(apc_lock_t *lock); PHP_APCU_API zend_bool apc_lock_rlock(apc_lock_t *lock); PHP_APCU_API zend_bool apc_lock_wlock(apc_lock_t *lock); PHP_APCU_API zend_bool apc_lock_runlock(apc_lock_t *lock); PHP_APCU_API zend_bool apc_lock_wunlock(apc_lock_t *lock); PHP_APCU_API void apc_lock_destroy(apc_lock_t *lock); /* }}} */ /* {{{ generic locking macros */ #define CREATE_LOCK(lock) apc_lock_create(lock) #define DESTROY_LOCK(lock) apc_lock_destroy(lock) #define WLOCK(lock) apc_lock_wlock(lock) #define WUNLOCK(lock) { apc_lock_wunlock(lock); HANDLE_UNBLOCK_INTERRUPTIONS(); } #define RLOCK(lock) apc_lock_rlock(lock) #define RUNLOCK(lock) { apc_lock_runlock(lock); HANDLE_UNBLOCK_INTERRUPTIONS(); } /* }}} */ /* atomic operations */ #ifdef PHP_WIN32 # ifdef _WIN64 # define ATOMIC_INC(a) InterlockedIncrement64(&a) # define ATOMIC_DEC(a) InterlockedDecrement64(&a) # define ATOMIC_ADD(a, b) (InterlockedExchangeAdd64(&a, b) + b) # define ATOMIC_CAS(a, old, new) (InterlockedCompareExchange64(&a, new, old) == old) # else # define ATOMIC_INC(a) InterlockedIncrement(&a) # define ATOMIC_DEC(a) InterlockedDecrement(&a) # define ATOMIC_ADD(a, b) (InterlockedExchangeAdd(&a, b) + b) # define ATOMIC_CAS(a, old, new) (InterlockedCompareExchange(&a, new, old) == old) # endif #else # define ATOMIC_INC(a) __sync_add_and_fetch(&a, 1) # define ATOMIC_DEC(a) __sync_sub_and_fetch(&a, 1) # define ATOMIC_ADD(a, b) __sync_add_and_fetch(&a, b) # define ATOMIC_CAS(a, old, new) __sync_bool_compare_and_swap(&a, old, new) #endif #endif PK "\:b4 4 php/ext/apcu/apc_cache.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Daniel Cowgill
| | Rasmus Lerdorf
| +----------------------------------------------------------------------+ This software was contributed to PHP by Community Connect Inc. in 2002 and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. Future revisions and derivatives of this source code must acknowledge Community Connect Inc. as the original contributor of this module by leaving this note intact in the source code. All other licensing and usage conditions are those of the PHP Group. */ #ifndef APC_CACHE_H #define APC_CACHE_H #include "apc.h" #include "apc_sma.h" #include "apc_lock.h" #include "apc_globals.h" #include "TSRM.h" typedef struct apc_cache_slam_key_t apc_cache_slam_key_t; struct apc_cache_slam_key_t { zend_ulong hash; /* hash of the key */ size_t len; /* length of the key */ time_t mtime; /* creation time of this key */ pid_t owner_pid; /* the pid that created this key */ #ifdef ZTS void ***owner_thread; /* TSRMLS cache of thread that created this key */ #endif }; /* {{{ struct definition: apc_cache_entry_t */ typedef struct apc_cache_entry_t apc_cache_entry_t; struct apc_cache_entry_t { zend_string *key; /* entry key */ zval val; /* the zval copied at store time */ apc_cache_entry_t *next; /* next entry in linked list */ zend_long ttl; /* the ttl on this specific entry */ zend_long ref_count; /* the reference count of this entry */ zend_long nhits; /* number of hits to this entry */ time_t ctime; /* time entry was initialized */ time_t mtime; /* the mtime of this cached entry */ time_t dtime; /* time entry was removed from cache */ time_t atime; /* time entry was last accessed */ zend_long mem_size; /* memory used */ }; /* }}} */ /* {{{ struct definition: apc_cache_header_t Any values that must be shared among processes should go in here. */ typedef struct _apc_cache_header_t { apc_lock_t lock; /* header lock */ zend_long nhits; /* hit count */ zend_long nmisses; /* miss count */ zend_long ninserts; /* insert count */ zend_long nexpunges; /* expunge count */ zend_long nentries; /* entry count */ zend_long mem_size; /* used */ time_t stime; /* start time */ unsigned short state; /* cache state */ apc_cache_slam_key_t lastkey; /* last key inserted (not necessarily without error) */ apc_cache_entry_t *gc; /* gc list */ } apc_cache_header_t; /* }}} */ /* {{{ struct definition: apc_cache_t */ typedef struct _apc_cache_t { void* shmaddr; /* process (local) address of shared cache */ apc_cache_header_t* header; /* cache header (stored in SHM) */ apc_cache_entry_t** slots; /* array of cache slots (stored in SHM) */ apc_sma_t* sma; /* shared memory allocator */ apc_serializer_t* serializer; /* serializer */ size_t nslots; /* number of slots in cache */ zend_long gc_ttl; /* maximum time on GC list for a entry */ zend_long ttl; /* if slot is needed and entry's access time is older than this ttl, remove it */ zend_long smart; /* smart parameter for gc */ zend_bool defend; /* defense parameter for runtime */ } apc_cache_t; /* }}} */ /* {{{ typedef: apc_cache_updater_t */ typedef zend_bool (*apc_cache_updater_t)(apc_cache_t*, apc_cache_entry_t*, void* data); /* }}} */ /* {{{ typedef: apc_cache_atomic_updater_t */ typedef zend_bool (*apc_cache_atomic_updater_t)(apc_cache_t*, zend_long*, void* data); /* }}} */ /* * apc_cache_create creates the shared memory cache. * * This function should be called once per process per cache * * serializer for APCu is set by globals on MINIT and ensured with apc_cache_serializer * during execution. Using apc_cache_serializer avoids race conditions between MINIT/RINIT of * APCU and the third party serializer. API users can choose to leave this null to use default * PHP serializers, or search the list of serializers for the preferred serializer * * size_hint is a "hint" at the total number entries that will be expected. * It determines the physical size of the hash table. Passing 0 for * this argument will use a reasonable default value * * gc_ttl is the maximum time a cache entry may speed on the garbage * collection list. This is basically a work around for the inherent * unreliability of our reference counting mechanism (see apc_cache_release). * * ttl is the maximum time a cache entry can idle in a slot in case the slot * is needed. This helps in cleaning up the cache and ensuring that entries * hit frequently stay cached and ones not hit very often eventually disappear. * * for an explanation of smart, see apc_cache_default_expunge * * defend enables/disables slam defense for this particular cache */ PHP_APCU_API apc_cache_t* apc_cache_create( apc_sma_t* sma, apc_serializer_t* serializer, zend_long size_hint, zend_long gc_ttl, zend_long ttl, zend_long smart, zend_bool defend); /* * apc_cache_preload preloads the data at path into the specified cache */ PHP_APCU_API zend_bool apc_cache_preload(apc_cache_t* cache, const char* path); /* * apc_cache_detach detaches from the shared memory cache and cleans up * local allocations. Under apache, this function can be safely called by * the child processes when they exit. */ PHP_APCU_API void apc_cache_detach(apc_cache_t* cache); /* * apc_cache_clear empties a cache. This can safely be called at any time. */ PHP_APCU_API void apc_cache_clear(apc_cache_t* cache); /* * apc_cache_store creates key, entry and context in which to make an insertion of val into the specified cache */ PHP_APCU_API zend_bool apc_cache_store( apc_cache_t* cache, zend_string *key, const zval *val, const int32_t ttl, const zend_bool exclusive); /* * apc_cache_update updates an entry in place. The updater function must not bailout. * The update is performed under write-lock and doesn't have to be atomic. */ PHP_APCU_API zend_bool apc_cache_update( apc_cache_t *cache, zend_string *key, apc_cache_updater_t updater, void *data, zend_bool insert_if_not_found, zend_long ttl); /* * apc_cache_atomic_update_long updates an integer entry in place. The updater function must * perform the update atomically, as the update is performed under read-lock. */ PHP_APCU_API zend_bool apc_cache_atomic_update_long( apc_cache_t *cache, zend_string *key, apc_cache_atomic_updater_t updater, void *data, zend_bool insert_if_not_found, zend_long ttl); /* * apc_cache_find searches for a cache entry by its hashed identifier, * and returns a pointer to the entry if found, NULL otherwise. * */ PHP_APCU_API apc_cache_entry_t* apc_cache_find(apc_cache_t* cache, zend_string *key, time_t t); /* * apc_cache_fetch fetches an entry from the cache directly into dst * */ PHP_APCU_API zend_bool apc_cache_fetch(apc_cache_t* cache, zend_string *key, time_t t, zval *dst); /* * apc_cache_exists searches for a cache entry by its hashed identifier, * and returns whether the entry exists. */ PHP_APCU_API zend_bool apc_cache_exists(apc_cache_t* cache, zend_string *key, time_t t); /* * apc_cache_delete and apc_cache_delete finds an entry in the cache and deletes it. */ PHP_APCU_API zend_bool apc_cache_delete(apc_cache_t* cache, zend_string *key); /* apc_cache_fetch_zval copies a cache entry value to be usable at runtime. */ PHP_APCU_API zend_bool apc_cache_entry_fetch_zval( apc_cache_t *cache, apc_cache_entry_t *entry, zval *dst); /* * apc_cache_entry_release decrements the reference count associated with a cache * entry. Calling apc_cache_find automatically increments the reference count, * and this function must be called post-execution to return the count to its * original value. Failing to do so will prevent the entry from being * garbage-collected. * * entry is the cache entry whose ref count you want to decrement. */ PHP_APCU_API void apc_cache_entry_release(apc_cache_t *cache, apc_cache_entry_t *entry); /* fetches information about the cache provided for userland status functions */ PHP_APCU_API zend_bool apc_cache_info(zval *info, apc_cache_t *cache, zend_bool limited); /* fetches information about the key provided */ PHP_APCU_API void apc_cache_stat(apc_cache_t *cache, zend_string *key, zval *stat); /* * apc_cache_defense: guard against slamming a key * will return true if the following conditions are met: * the key provided has a matching hash and length to the last key inserted into cache * the last key has a different owner * in ZTS mode, TSRM determines owner * in non-ZTS mode, PID determines owner * Note: this function sets the owner of key during execution */ PHP_APCU_API zend_bool apc_cache_defense(apc_cache_t *cache, zend_string *key, time_t t); /* * apc_cache_serializer * sets the serializer for a cache, and by proxy contexts created for the cache * Note: this avoids race conditions between third party serializers and APCu */ PHP_APCU_API void apc_cache_serializer(apc_cache_t* cache, const char* name); /* * The remaining functions allow a third party to reimplement expunge * * Look at the source of apc_cache_default_expunge for what is expected of this function * * The default behaviour of expunge is explained below, should no combination of those options * be suitable, you will need to reimplement apc_cache_default_expunge and pass it to your * call to apc_sma_api_impl, this will replace the default functionality. * The functions below you can use during your own implementation of expunge to gain more * control over how the expunge process works ... * * Note: beware of locking (copy it exactly), setting states is also important */ /* {{{ apc_cache_default_expunge * Where smart is not set: * Where no ttl is set on cache: * 1) Perform cleanup of stale entries * 2) Expunge if available memory is less than sma->size/2 * Where ttl is set on cache: * 1) Perform cleanup of stale entries * 2) If available memory if less than the size requested, run full expunge * * Where smart is set: * Where no ttl is set on cache: * 1) Perform cleanup of stale entries * 2) Expunge is available memory is less than size * smart * Where ttl is set on cache: * 1) Perform cleanup of stale entries * 2) If available memory if less than the size requested, run full expunge * * The TTL of an entry takes precedence over the TTL of a cache */ PHP_APCU_API void apc_cache_default_expunge(apc_cache_t* cache, size_t size); /* * apc_cache_entry: generate and create or fetch an entry * * @see https://github.com/krakjoe/apcu/issues/142 */ PHP_APCU_API void apc_cache_entry(apc_cache_t *cache, zend_string *key, zend_fcall_info *fci, zend_fcall_info_cache *fcc, zend_long ttl, zend_long now, zval *return_value); /* apcu_entry() holds a write lock on the cache while executing user code. * That code may call other apcu_* functions, which also try to acquire a * read or write lock, which would deadlock. As such, don't try to acquire a * lock if the current thread is inside apcu_entry(). * * Whether the current thread is inside apcu_entry() is tracked by APCG(entry_level). * This breaks the self-contained apc_cache_t abstraction, but is currently * necessary because the entry_level needs to be tracked per-thread, while * apc_cache_t is a per-process structure. */ static inline zend_bool apc_cache_wlock(apc_cache_t *cache) { if (!APCG(entry_level)) { return WLOCK(&cache->header->lock); } return 1; } static inline void apc_cache_wunlock(apc_cache_t *cache) { if (!APCG(entry_level)) { WUNLOCK(&cache->header->lock); } } static inline zend_bool apc_cache_rlock(apc_cache_t *cache) { if (!APCG(entry_level)) { return RLOCK(&cache->header->lock); } return 1; } static inline void apc_cache_runlock(apc_cache_t *cache) { if (!APCG(entry_level)) { RUNLOCK(&cache->header->lock); } } #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker * vim<600: noexpandtab sw=4 ts=4 sts=4 */ PK "\B& & php/ext/apcu/apc_iterator.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Brian Shire
| +----------------------------------------------------------------------+ */ #ifndef APC_ITERATOR_H #define APC_ITERATOR_H #include "apc.h" #include "apc_stack.h" #include "ext/pcre/php_pcre.h" #include "zend_smart_str.h" #define APC_DEFAULT_CHUNK_SIZE 100 #define APC_LIST_ACTIVE 0x1 #define APC_LIST_DELETED 0x2 #define APC_ITER_TYPE (1 << 0) #define APC_ITER_KEY (1 << 1) #define APC_ITER_VALUE (1 << 2) #define APC_ITER_NUM_HITS (1 << 3) #define APC_ITER_MTIME (1 << 4) #define APC_ITER_CTIME (1 << 5) #define APC_ITER_DTIME (1 << 6) #define APC_ITER_ATIME (1 << 7) #define APC_ITER_REFCOUNT (1 << 8) #define APC_ITER_MEM_SIZE (1 << 9) #define APC_ITER_TTL (1 << 10) #define APC_ITER_NONE 0 #define APC_ITER_ALL (0xffffffffL) /* {{{ apc_iterator_t */ typedef struct _apc_iterator_t { short int initialized; /* sanity check in case __construct failed */ zend_long format; /* format bitmask of the return values ie: key, value, info */ size_t (*fetch)(struct _apc_iterator_t *iterator); /* fetch callback to fetch items from cache slots or lists */ size_t slot_idx; /* index to the slot array or linked list */ size_t chunk_size; /* number of entries to pull down per fetch */ apc_stack_t *stack; /* stack of entries pulled from cache */ int stack_idx; /* index into the current stack */ pcre_cache_entry *pce; /* regex filter on entry identifiers */ #if PHP_VERSION_ID >= 70300 pcre2_match_data *re_match_data; /* match data for regex */ #endif zend_string *regex; HashTable *search_hash; /* hash of keys to iterate over */ zend_long key_idx; /* incrementing index for numerical keys */ short int totals_flag; /* flag if totals have been calculated */ zend_long hits; /* hit total */ size_t size; /* size total */ zend_long count; /* count total */ zend_object obj; } apc_iterator_t; /* }}} */ #define apc_iterator_fetch_from(o) ((apc_iterator_t*)((char*)o - XtOffsetOf(apc_iterator_t, obj))) #define apc_iterator_fetch(z) apc_iterator_fetch_from(Z_OBJ_P(z)) /* {{{ apc_iterator_item */ typedef struct _apc_iterator_item_t { zend_string *key; zval value; } apc_iterator_item_t; /* }}} */ PHP_APCU_API void apc_iterator_obj_init( apc_iterator_t *iterator, zval *search, zend_long format, size_t chunk_size, zend_long list); PHP_APCU_API zend_class_entry* apc_iterator_get_ce(void); PHP_APCU_API int apc_iterator_init(int module_number); PHP_APCU_API int apc_iterator_shutdown(int module_number); extern int apc_iterator_delete(zval *key); #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker * vim<600: noexpandtab sw=4 ts=4 sts=4 */ PK "\6d php/ext/apcu/php_apc.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Daniel Cowgill
| | George Schlossnagle
| | Rasmus Lerdorf
| +----------------------------------------------------------------------+ This software was contributed to PHP by Community Connect Inc. in 2002 and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. Future revisions and derivatives of this source code must acknowledge Community Connect Inc. as the original contributor of this module by leaving this note intact in the source code. All other licensing and usage conditions are those of the PHP Group. */ #ifndef PHP_APCU_H #define PHP_APCU_H #include "apc.h" #include "apc_globals.h" #define PHP_APCU_VERSION "5.1.23" #define PHP_APCU_EXTNAME "apcu" PHP_APCU_API zend_bool apc_is_enabled(void); extern zend_module_entry apcu_module_entry; #define apcu_module_ptr &apcu_module_entry #define phpext_apcu_ptr apcu_module_ptr #if defined(ZTS) && defined(COMPILE_DL_APCU) ZEND_TSRMLS_CACHE_EXTERN(); #endif #endif /* PHP_APC_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker * vim<600: noexpandtab sw=4 ts=4 sts=4 */ PK "\34 4 php/ext/apcu/apc_globals.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Daniel Cowgill
| | George Schlossnagle
| | Rasmus Lerdorf
| | Arun C. Murthy
| | Gopal Vijayaraghavan
| +----------------------------------------------------------------------+ This software was contributed to PHP by Community Connect Inc. in 2002 and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. Future revisions and derivatives of this source code must acknowledge Community Connect Inc. as the original contributor of this module by leaving this note intact in the source code. All other licensing and usage conditions are those of the PHP Group. */ #ifndef APC_GLOBALS_H #define APC_GLOBALS_H #include "apc.h" ZEND_BEGIN_MODULE_GLOBALS(apcu) /* configuration parameters */ zend_bool enabled; /* if true, apc is enabled (defaults to true) */ zend_long shm_segments; /* number of shared memory segments to use */ zend_long shm_size; /* size of each shared memory segment (in MB) */ zend_long entries_hint; /* hint at the number of entries expected */ zend_long gc_ttl; /* parameter to apc_cache_create */ zend_long ttl; /* parameter to apc_cache_create */ zend_long smart; /* smart value */ #if APC_MMAP char *mmap_file_mask; /* mktemp-style file-mask to pass to mmap */ #endif /* module variables */ zend_bool initialized; /* true if module was initialized */ zend_bool enable_cli; /* Flag to override turning APC off for CLI */ zend_bool slam_defense; /* true for user cache slam defense */ char *preload_path; /* preload path */ zend_bool coredump_unmap; /* trap signals that coredump and unmap shared memory */ zend_bool use_request_time; /* use the SAPI request start time for TTL */ time_t request_time; /* cached request time */ char *serializer_name; /* the serializer config option */ /* Nesting level of apcu_entry calls. */ unsigned int entry_level; ZEND_END_MODULE_GLOBALS(apcu) /* (the following is defined in php_apc.c) */ ZEND_EXTERN_MODULE_GLOBALS(apcu) #ifdef ZTS # define APCG(v) TSRMG(apcu_globals_id, zend_apcu_globals *, v) #else # define APCG(v) (apcu_globals.v) #endif extern struct _apc_cache_t* apc_user_cache; #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker * vim<600: noexpandtab sw=4 ts=4 sts=4 */ PK "\Uw) php/ext/apcu/apc_serializer.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt. | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Gopal Vijayaraghavan
| +----------------------------------------------------------------------+ */ #ifndef APC_SERIALIZER_H #define APC_SERIALIZER_H /* this is a shipped .h file, do not include any other header in this file */ #define APC_SERIALIZER_NAME(module) module##_apc_serializer #define APC_UNSERIALIZER_NAME(module) module##_apc_unserializer #define APC_SERIALIZER_ARGS unsigned char **buf, size_t *buf_len, const zval *value, void *config #define APC_UNSERIALIZER_ARGS zval *value, unsigned char *buf, size_t buf_len, void *config typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS); typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS); typedef int (*apc_register_serializer_t)(const char* name, apc_serialize_t serialize, apc_unserialize_t unserialize, void *config); /* * ABI version for constant hooks. Increment this any time you make any changes * to any function in this file. */ #define APC_SERIALIZER_ABI "0" #define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI #if !defined(APC_UNUSED) # if defined(__GNUC__) # define APC_UNUSED __attribute__((unused)) # else # define APC_UNUSED # endif #endif static APC_UNUSED int apc_register_serializer( const char* name, apc_serialize_t serialize, apc_unserialize_t unserialize, void *config) { int retval = 0; zend_string *lookup = zend_string_init( APC_SERIALIZER_CONSTANT, sizeof(APC_SERIALIZER_CONSTANT)-1, 0); zval *magic = zend_get_constant(lookup); /* zend_get_constant will return 1 on success, otherwise apc_magic_constant wouldn't be touched at all */ if (magic) { apc_register_serializer_t register_func = (apc_register_serializer_t)(Z_LVAL_P(magic)); if(register_func) { retval = register_func(name, serialize, unserialize, NULL); } } zend_string_release(lookup); return retval; } #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker * vim<600: noexpandtab sw=4 ts=4 sts=4 */ PK "\Ti php/ext/apcu/apc_sma.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Daniel Cowgill
| +----------------------------------------------------------------------+ This software was contributed to PHP by Community Connect Inc. in 2002 and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. Future revisions and derivatives of this source code must acknowledge Community Connect Inc. as the original contributor of this module by leaving this note intact in the source code. All other licensing and usage conditions are those of the PHP Group. */ #ifndef APC_SMA_H #define APC_SMA_H /* {{{ SMA API APC SMA API provides support for shared memory allocators to external libraries ( and to APC ) Skip to the bottom macros for error free usage of the SMA API */ #include "apc.h" /* {{{ struct definition: apc_segment_t */ typedef struct _apc_segment_t { size_t size; /* size of this segment */ void* shmaddr; /* address of shared memory */ #ifdef APC_MEMPROTECT void* roaddr; /* read only (mprotect'd) address */ #endif } apc_segment_t; /* }}} */ /* {{{ struct definition: apc_sma_link_t */ typedef struct apc_sma_link_t apc_sma_link_t; struct apc_sma_link_t { zend_long size; /* size of this free block */ zend_long offset; /* offset in segment of this block */ apc_sma_link_t* next; /* link to next free block */ }; /* }}} */ /* {{{ struct definition: apc_sma_info_t */ typedef struct apc_sma_info_t apc_sma_info_t; struct apc_sma_info_t { int num_seg; /* number of segments */ size_t seg_size; /* segment size */ apc_sma_link_t** list; /* one list per segment of links */ }; /* }}} */ typedef void (*apc_sma_expunge_f)(void *pointer, size_t size); /* }}} */ /* {{{ struct definition: apc_sma_t */ typedef struct _apc_sma_t { zend_bool initialized; /* flag to indicate this sma has been initialized */ /* callback */ apc_sma_expunge_f expunge; /* expunge */ void** data; /* expunge data */ /* info */ int32_t num; /* number of segments */ size_t size; /* segment size */ int32_t last; /* last segment */ /* segments */ apc_segment_t *segs; /* segments */ } apc_sma_t; /* }}} */ /* * apc_sma_api_init will initialize a shared memory allocator with num segments of the given size * * should be called once per allocator per process */ PHP_APCU_API void apc_sma_init( apc_sma_t* sma, void** data, apc_sma_expunge_f expunge, int32_t num, size_t size, char *mask); /* * apc_sma_detach will detach from shared memory and cleanup local allocations. */ PHP_APCU_API void apc_sma_detach(apc_sma_t* sma); /* * apc_smap_api_malloc will allocate a block from the sma of the given size */ PHP_APCU_API void* apc_sma_malloc(apc_sma_t* sma, size_t size); /* * apc_sma_api_malloc_ex will allocate a block from the sma of the given size and * provide the size of the actual allocation. */ PHP_APCU_API void *apc_sma_malloc_ex( apc_sma_t *sma, size_t size, size_t *allocated); /* * apc_sma_api_free will free p (which should be a pointer to a block allocated from sma) */ PHP_APCU_API void apc_sma_free(apc_sma_t* sma, void* p); /* * apc_sma_api_protect will protect p (which should be a pointer to a block allocated from sma) */ PHP_APCU_API void* apc_sma_protect(apc_sma_t* sma, void* p); /* * apc_sma_api_protect will uprotect p (which should be a pointer to a block allocated from sma) */ PHP_APCU_API void* apc_sma_unprotect(apc_sma_t* sma, void *p); /* * apc_sma_api_info returns information about the allocator */ PHP_APCU_API apc_sma_info_t* apc_sma_info(apc_sma_t* sma, zend_bool limited); /* * apc_sma_api_info_free_info is for freeing apc_sma_info_t* returned by apc_sma_api_info */ PHP_APCU_API void apc_sma_free_info(apc_sma_t* sma, apc_sma_info_t* info); /* * apc_sma_api_get_avail_mem will return the amount of memory available left to sma */ PHP_APCU_API size_t apc_sma_get_avail_mem(apc_sma_t* sma); /* * apc_sma_api_get_avail_size will return true if at least size bytes are available to the sma */ PHP_APCU_API zend_bool apc_sma_get_avail_size(apc_sma_t* sma, size_t size); /* * apc_sma_api_check_integrity will check the integrity of sma */ PHP_APCU_API void apc_sma_check_integrity(apc_sma_t* sma); /* }}} */ /* {{{ ALIGNWORD: pad up x, aligned to the system's word boundary */ typedef union { void* p; int i; long l; double d; void (*f)(void); } apc_word_t; #define ALIGNSIZE(x, size) ((size) * (1 + (((x)-1)/(size)))) #define ALIGNWORD(x) ALIGNSIZE(x, sizeof(apc_word_t)) /* }}} */ #endif PK "\q q php/ext/apcu/apc_arginfo.hnu [ #if PHP_VERSION_ID < 80000 # include "php_apc_legacy_arginfo.h" #else # error Not supported on PHP >= 8.0 #endif PK "\7J php/ext/apcu/apc.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Daniel Cowgill
| | George Schlossnagle
| | Rasmus Lerdorf
| | Arun C. Murthy
| | Gopal Vijayaraghavan
| +----------------------------------------------------------------------+ This software was contributed to PHP by Community Connect Inc. in 2002 and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. Future revisions and derivatives of this source code must acknowledge Community Connect Inc. as the original contributor of this module by leaving this note intact in the source code. All other licensing and usage conditions are those of the PHP Group. */ #ifndef APC_H #define APC_H /* * This module defines utilities and helper functions used elsewhere in APC. */ #ifdef PHP_WIN32 # define PHP_APCU_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_APCU_API __attribute__ ((visibility("default"))) #else # define PHP_APCU_API #endif /* Commonly needed C library headers. */ #include
#include
#include
#include
#include
#include
#include
#include
/* UNIX headers (needed for struct stat) */ #include
#include
#ifndef PHP_WIN32 #include
#endif #ifdef HAVE_CONFIG_H #include
#endif #include "php.h" #include "main/php_streams.h" /* console display functions */ PHP_APCU_API void apc_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); PHP_APCU_API void apc_warning(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); PHP_APCU_API void apc_notice(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); PHP_APCU_API void apc_debug(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2); /* apc_flip_hash flips keys and values for faster searching */ PHP_APCU_API HashTable* apc_flip_hash(HashTable *hash); #if defined(__GNUC__) # define APC_UNUSED __attribute__((unused)) # define APC_USED __attribute__((used)) # define APC_ALLOC __attribute__((malloc)) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2) # define APC_HOTSPOT __attribute__((hot)) # else # define APC_HOTSPOT # endif #else # define APC_UNUSED # define APC_USED # define APC_ALLOC # define APC_HOTSPOT #endif /* * Serializer API */ #define APC_SERIALIZER_ABI "0" #define APC_SERIALIZER_CONSTANT "\000apc_register_serializer-" APC_SERIALIZER_ABI #define APC_SERIALIZER_NAME(module) module##_apc_serializer #define APC_UNSERIALIZER_NAME(module) module##_apc_unserializer #define APC_SERIALIZER_ARGS unsigned char **buf, size_t *buf_len, const zval *value, void *config #define APC_UNSERIALIZER_ARGS zval *value, unsigned char *buf, size_t buf_len, void *config typedef int (*apc_serialize_t)(APC_SERIALIZER_ARGS); typedef int (*apc_unserialize_t)(APC_UNSERIALIZER_ARGS); /* {{{ struct definition: apc_serializer_t */ typedef struct apc_serializer_t { const char* name; apc_serialize_t serialize; apc_unserialize_t unserialize; void* config; } apc_serializer_t; /* }}} */ /* {{{ _apc_register_serializer registers the serializer using the given name and parameters */ PHP_APCU_API int _apc_register_serializer( const char* name, apc_serialize_t serialize, apc_unserialize_t unserialize, void *config); /* }}} */ /* {{{ apc_get_serializers fetches the list of serializers */ PHP_APCU_API apc_serializer_t* apc_get_serializers(void); /* }}} */ /* {{{ apc_find_serializer finds a previously registered serializer by name */ PHP_APCU_API apc_serializer_t* apc_find_serializer(const char* name); /* }}} */ /* {{{ default serializers */ PHP_APCU_API int APC_SERIALIZER_NAME(php) (APC_SERIALIZER_ARGS); PHP_APCU_API int APC_UNSERIALIZER_NAME(php) (APC_UNSERIALIZER_ARGS); /* }}} */ #define php_apc_try \ { \ JMP_BUF *zb = EG(bailout); \ JMP_BUF ab; \ zend_bool _bailout = 0; \ \ EG(bailout) = &ab; \ if (SETJMP(ab) == SUCCESS) { #define php_apc_finally \ } else { \ _bailout = 1; \ } #define php_apc_end_try() \ EG(bailout) = zb; \ if (_bailout) { \ zend_bailout(); \ } \ } #define php_apc_try_finish() (EG(bailout) = zb) #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker * vim<600: noexpandtab sw=4 ts=4 sts=4 */ PK "\B php/ext/apcu/apc_mutex.hnu [ /* +----------------------------------------------------------------------+ | APCu | +----------------------------------------------------------------------+ | Copyright (c) 2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Joe Watkins
| +----------------------------------------------------------------------+ */ #ifndef APC_MUTEX_H #define APC_MUTEX_H #include "apc.h" #ifdef APC_HAS_PTHREAD_MUTEX #include "pthread.h" typedef pthread_mutex_t apc_mutex_t; PHP_APCU_API zend_bool apc_mutex_init(void); PHP_APCU_API void apc_mutex_cleanup(void); PHP_APCU_API zend_bool apc_mutex_create(apc_mutex_t *lock); PHP_APCU_API zend_bool apc_mutex_lock(apc_mutex_t *lock); PHP_APCU_API zend_bool apc_mutex_unlock(apc_mutex_t *lock); PHP_APCU_API void apc_mutex_destroy(apc_mutex_t *lock); #define APC_MUTEX_INIT() apc_mutex_init() #define APC_MUTEX_CLEANUP() apc_mutex_cleanup() #define APC_CREATE_MUTEX(lock) apc_mutex_create(lock) #define APC_DESTROY_MUTEX(lock) apc_mutex_destroy(lock) #define APC_MUTEX_LOCK(lock) apc_mutex_lock(lock) #define APC_MUTEX_UNLOCK(lock) apc_mutex_unlock(lock) #else #include "apc_lock.h" typedef apc_lock_t apc_mutex_t; // Fallback to normal locks #define APC_MUTEX_INIT() #define APC_MUTEX_CLEANUP() #define APC_CREATE_MUTEX(lock) CREATE_LOCK(lock) #define APC_DESTROY_MUTEX(lock) DESTROY_LOCK(lock) #define APC_MUTEX_LOCK(lock) WLOCK(lock) #define APC_MUTEX_UNLOCK(lock) WUNLOCK(lock) #endif #endif PK "\ɶڥ % php/ext/apcu/php_apc_legacy_arginfo.hnu [ /* This is a generated file, edit the .stub.php file instead. * Stub hash: 5282d856fd334278d5799581ad251977a3c6b18e */ ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_clear_cache, 0, 0, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cache_info, 0, 0, 0) ZEND_ARG_INFO(0, limited) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_key_info, 0, 0, 1) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() #define arginfo_apcu_sma_info arginfo_apcu_cache_info #define arginfo_apcu_enabled arginfo_apcu_clear_cache ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_store, 0, 0, 1) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(0, ttl) ZEND_END_ARG_INFO() #define arginfo_apcu_add arginfo_apcu_store ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_inc, 0, 0, 1) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, step) ZEND_ARG_INFO(1, success) ZEND_ARG_INFO(0, ttl) ZEND_END_ARG_INFO() #define arginfo_apcu_dec arginfo_apcu_inc ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_cas, 0, 0, 3) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, old) ZEND_ARG_INFO(0, new) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_fetch, 0, 0, 1) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(1, success) ZEND_END_ARG_INFO() #define arginfo_apcu_exists arginfo_apcu_key_info #define arginfo_apcu_delete arginfo_apcu_key_info ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_entry, 0, 0, 2) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, callback) ZEND_ARG_INFO(0, ttl) ZEND_END_ARG_INFO() #if defined(APC_DEBUG) ZEND_BEGIN_ARG_INFO_EX(arginfo_apcu_inc_request_time, 0, 0, 0) ZEND_ARG_INFO(0, by) ZEND_END_ARG_INFO() #endif PHP_APCU_API ZEND_FUNCTION(apcu_clear_cache); PHP_APCU_API ZEND_FUNCTION(apcu_cache_info); PHP_APCU_API ZEND_FUNCTION(apcu_key_info); PHP_APCU_API ZEND_FUNCTION(apcu_sma_info); PHP_APCU_API ZEND_FUNCTION(apcu_enabled); PHP_APCU_API ZEND_FUNCTION(apcu_store); PHP_APCU_API ZEND_FUNCTION(apcu_add); PHP_APCU_API ZEND_FUNCTION(apcu_inc); PHP_APCU_API ZEND_FUNCTION(apcu_dec); PHP_APCU_API ZEND_FUNCTION(apcu_cas); PHP_APCU_API ZEND_FUNCTION(apcu_fetch); PHP_APCU_API ZEND_FUNCTION(apcu_exists); PHP_APCU_API ZEND_FUNCTION(apcu_delete); PHP_APCU_API ZEND_FUNCTION(apcu_entry); #if defined(APC_DEBUG) PHP_APCU_API ZEND_FUNCTION(apcu_inc_request_time); #endif static const zend_function_entry ext_functions[] = { ZEND_FE(apcu_clear_cache, arginfo_apcu_clear_cache) ZEND_FE(apcu_cache_info, arginfo_apcu_cache_info) ZEND_FE(apcu_key_info, arginfo_apcu_key_info) ZEND_FE(apcu_sma_info, arginfo_apcu_sma_info) ZEND_FE(apcu_enabled, arginfo_apcu_enabled) ZEND_FE(apcu_store, arginfo_apcu_store) ZEND_FE(apcu_add, arginfo_apcu_add) ZEND_FE(apcu_inc, arginfo_apcu_inc) ZEND_FE(apcu_dec, arginfo_apcu_dec) ZEND_FE(apcu_cas, arginfo_apcu_cas) ZEND_FE(apcu_fetch, arginfo_apcu_fetch) ZEND_FE(apcu_exists, arginfo_apcu_exists) ZEND_FE(apcu_delete, arginfo_apcu_delete) ZEND_FE(apcu_entry, arginfo_apcu_entry) #if defined(APC_DEBUG) ZEND_FE(apcu_inc_request_time, arginfo_apcu_inc_request_time) #endif ZEND_FE_END }; PK "\ php/ext/apcu/apc_stack.hnu [ /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006-2011 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Daniel Cowgill
| | George Schlossnagle
| +----------------------------------------------------------------------+ This software was contributed to PHP by Community Connect Inc. in 2002 and revised in 2005 by Yahoo! Inc. to add support for PHP 5.1. Future revisions and derivatives of this source code must acknowledge Community Connect Inc. as the original contributor of this module by leaving this note intact in the source code. All other licensing and usage conditions are those of the PHP Group. */ #ifndef APC_STACK_H #define APC_STACK_H /* Basic stack datatype */ #define T apc_stack_t* typedef struct apc_stack_t apc_stack_t; /* opaque stack type */ extern T apc_stack_create(size_t size_hint); extern void apc_stack_destroy(T stack); extern void apc_stack_clear(T stack); extern void apc_stack_push(T stack, void* item); extern void* apc_stack_pop(T stack); extern void* apc_stack_top(T stack); extern void* apc_stack_get(T stack, size_t n); extern int apc_stack_size(T stack); #undef T #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim>600: noexpandtab sw=4 ts=4 sts=4 fdm=marker * vim<600: noexpandtab sw=4 ts=4 sts=4 */ PK "\9< php/ext/apcu/apc_api.hnu [ /* +----------------------------------------------------------------------+ | APCu | +----------------------------------------------------------------------+ | Copyright (c) 2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Joe Watkins
| +----------------------------------------------------------------------+ */ #ifndef APC_API_H #define APC_API_H #include "apc.h" #include "apc_lock.h" #include "apc_sma.h" #include "apc_cache.h" #endif PK "\ % php/ext/mysqlnd/mysqlnd_reverse_api.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| | Georg Richter
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_REVERSE_API_H #define MYSQLND_REVERSE_API_H typedef struct st_mysqlnd_reverse_api { zend_module_entry * module; MYSQLND *(*conversion_cb)(zval * zv); } MYSQLND_REVERSE_API; PHPAPI void mysqlnd_reverse_api_init(void); PHPAPI void mysqlnd_reverse_api_end(void); PHPAPI HashTable * mysqlnd_reverse_api_get_api_list(void); PHPAPI void mysqlnd_reverse_api_register_api(MYSQLND_REVERSE_API * apiext); PHPAPI MYSQLND * zval_to_mysqlnd(zval * zv, const unsigned int client_api_capabilities, unsigned int * save_client_api_capabilities); #endif /* MYSQLND_REVERSE_API_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\V . php/ext/mysqlnd/mysqlnd_protocol_frame_codec.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_PROTOCOL_FRAME_CODEC_H #define MYSQLND_PROTOCOL_FRAME_CODEC_H PHPAPI MYSQLND_PFC * mysqlnd_pfc_init(const zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info); PHPAPI void mysqlnd_pfc_free(MYSQLND_PFC * const pfc, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info); #endif /* MYSQLND_PROTOCOL_FRAME_CODEC_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\J"q^ ^ php/ext/mysqlnd/mysqlnd_alloc.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_ALLOC_H #define MYSQLND_ALLOC_H PHPAPI extern const char * mysqlnd_debug_std_no_trace_funcs[]; #define MYSQLND_MEM_D ZEND_FILE_LINE_DC #define MYSQLND_MEM_C ZEND_FILE_LINE_CC struct st_mysqlnd_allocator_methods { void * (*m_emalloc)(size_t size MYSQLND_MEM_D); void * (*m_pemalloc)(size_t size, zend_bool persistent MYSQLND_MEM_D); void * (*m_ecalloc)(unsigned int nmemb, size_t size MYSQLND_MEM_D); void * (*m_pecalloc)(unsigned int nmemb, size_t size, zend_bool persistent MYSQLND_MEM_D); void * (*m_erealloc)(void *ptr, size_t new_size MYSQLND_MEM_D); void * (*m_perealloc)(void *ptr, size_t new_size, zend_bool persistent MYSQLND_MEM_D); void (*m_efree)(void *ptr MYSQLND_MEM_D); void (*m_pefree)(void *ptr, zend_bool persistent MYSQLND_MEM_D); void * (*m_malloc)(size_t size MYSQLND_MEM_D); void * (*m_calloc)(unsigned int nmemb, size_t size MYSQLND_MEM_D); void * (*m_realloc)(void *ptr, size_t new_size MYSQLND_MEM_D); void (*m_free)(void *ptr MYSQLND_MEM_D); char * (*m_pememdup)(const char * const ptr, size_t size, zend_bool persistent MYSQLND_MEM_D); char * (*m_pestrndup)(const char * const ptr, size_t size, zend_bool persistent MYSQLND_MEM_D); char * (*m_pestrdup)(const char * const ptr, zend_bool persistent MYSQLND_MEM_D); int (*m_sprintf)(char **pbuf, size_t max_len, const char *format, ...); int (*m_vsprintf)(char **pbuf, size_t max_len, const char *format, va_list ap); void (*m_sprintf_free)(char * p); }; PHPAPI extern struct st_mysqlnd_allocator_methods mysqlnd_allocator; #define mnd_emalloc(size) mysqlnd_allocator.m_emalloc((size) MYSQLND_MEM_C) #define mnd_pemalloc(size, pers) mysqlnd_allocator.m_pemalloc((size), (pers) MYSQLND_MEM_C) #define mnd_ecalloc(nmemb, size) mysqlnd_allocator.m_ecalloc((nmemb), (size) MYSQLND_MEM_C) #define mnd_pecalloc(nmemb, size, p) mysqlnd_allocator.m_pecalloc((nmemb), (size), (p) MYSQLND_MEM_C) #define mnd_erealloc(ptr, new_size) mysqlnd_allocator.m_erealloc((ptr), (new_size) MYSQLND_MEM_C) #define mnd_perealloc(ptr, new_size, p) mysqlnd_allocator.m_perealloc((ptr), (new_size), (p) MYSQLND_MEM_C) #define mnd_efree(ptr) mysqlnd_allocator.m_efree((ptr) MYSQLND_MEM_C) #define mnd_pefree(ptr, pers) mysqlnd_allocator.m_pefree((ptr), (pers) MYSQLND_MEM_C) #define mnd_malloc(size) mysqlnd_allocator.m_malloc((size) MYSQLND_MEM_C) #define mnd_calloc(nmemb, size) mysqlnd_allocator.m_calloc((nmemb), (size) MYSQLND_MEM_C) #define mnd_realloc(ptr, new_size) mysqlnd_allocator.m_realloc((ptr), (new_size) MYSQLND_MEM_C) #define mnd_free(ptr) mysqlnd_allocator.m_free((ptr) MYSQLND_MEM_C) #define mnd_pememdup(ptr, size, pers) mysqlnd_allocator.m_pememdup((ptr), (size), (pers) MYSQLND_MEM_C) #define mnd_pestrndup(ptr, size, pers) mysqlnd_allocator.m_pestrndup((ptr), (size), (pers) MYSQLND_MEM_C) #define mnd_pestrdup(ptr, pers) mysqlnd_allocator.m_pestrdup((ptr), (pers) MYSQLND_MEM_C) #define mnd_sprintf(p, mx_len, fmt,...) mysqlnd_allocator.m_sprintf((p), (mx_len), (fmt), __VA_ARGS__) #define mnd_vsprintf(p, mx_len, fmt,ap) mysqlnd_allocator.m_vsprintf((p), (mx_len), (fmt), (ap)) #define mnd_sprintf_free(p) mysqlnd_allocator.m_sprintf_free((p)) static inline MYSQLND_STRING mnd_dup_cstring(const MYSQLND_CSTRING str, const zend_bool persistent) { const MYSQLND_STRING ret = {(char*) mnd_pemalloc(str.l + 1, persistent), str.l}; if (ret.s) { memcpy(ret.s, str.s, str.l); ret.s[str.l] = '\0'; } return ret; } static inline MYSQLND_CSTRING mnd_str2c(const MYSQLND_STRING str) { const MYSQLND_CSTRING ret = {str.s, str.l}; return ret; } #endif /* MYSQLND_ALLOC_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\B B % php/ext/mysqlnd/mysqlnd_portability.hnu [ /* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB This file is public domain and comes with NO WARRANTY of any kind */ /* Parts of the original, which are not applicable to mysqlnd have been removed. With small modifications, mostly casting but adding few more macros by Andrey Hristov
. The additions are in the public domain and were added to improve the header file, to get it more consistent. */ #ifndef MYSQLND_PORTABILITY_H #define MYSQLND_PORTABILITY_H /* Comes from global.h as OFFSET, renamed to STRUCT_OFFSET */ #define STRUCT_OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) #ifndef __attribute #if !defined(__GNUC__) #define __attribute(A) #endif #endif #ifdef __CYGWIN__ /* We use a Unix API, so pretend it's not Windows */ #undef WIN #undef WIN32 #undef _WIN #undef _WIN32 #undef _WIN64 #undef __WIN__ #undef __WIN32__ #endif /* __CYGWIN__ */ #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) # include "ext/mysqlnd/config-win.h" #endif /* _WIN32... */ #if __STDC_VERSION__ < 199901L && !defined(atoll) /* "inline" is a keyword */ #define atoll atol #endif #include "php_stdint.h" #if SIZEOF_LONG_LONG > 4 && !defined(_LONG_LONG) #define _LONG_LONG 1 /* For AIX string library */ #endif /* Go around some bugs in different OS and compilers */ #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) #include
/* HPUX 10.20 defines ulong here. UGLY !!! */ #define HAVE_ULONG #endif #if SIZEOF_LONG_LONG > 4 #define HAVE_LONG_LONG 1 #endif #ifdef PHP_WIN32 #define MYSQLND_LLU_SPEC "%I64u" #define MYSQLND_LL_SPEC "%I64d" #define MYSQLND_SZ_T_SPEC "%Id" #ifndef L64 #define L64(x) x##i64 #endif #else #if __i386__ #define MYSQLND_LL_SPEC "%lli" #define MYSQLND_LLU_SPEC "%llu" #endif #if __ia64__ #define MYSQLND_LL_SPEC "%li" #define MYSQLND_LLU_SPEC "%lu" #endif #if __powerpc64__ || __ppc64__ #define MYSQLND_LL_SPEC "%li" #define MYSQLND_LLU_SPEC "%lu" #endif #if (__powerpc__ || __ppc__ ) && !(__powerpc64__ || __ppc64__) #define MYSQLND_LL_SPEC "%lli" #define MYSQLND_LLU_SPEC "%llu" #endif #if __x86_64__ #define MYSQLND_LL_SPEC "%li" #define MYSQLND_LLU_SPEC "%lu" #endif #if __s390x__ #define MYSQLND_LL_SPEC "%li" #define MYSQLND_LLU_SPEC "%lu" #endif #if __s390__ && !__s390x__ #define MYSQLND_LL_SPEC "%lli" #define MYSQLND_LLU_SPEC "%llu" #endif #ifdef _AIX #define MYSQLND_LL_SPEC "%lli" #define MYSQLND_LLU_SPEC "%llu" #endif #ifndef MYSQLND_LL_SPEC #if SIZEOF_LONG == 8 #define MYSQLND_LL_SPEC "%li" #elif SIZEOF_LONG == 4 #define MYSQLND_LL_SPEC "%lli" #endif #endif #ifndef MYSQLND_LLU_SPEC #if SIZEOF_LONG == 8 #define MYSQLND_LLU_SPEC "%lu" #elif SIZEOF_LONG == 4 #define MYSQLND_LLU_SPEC "%llu" #endif #endif /* MYSQLND_LLU_SPEC*/ #define MYSQLND_SZ_T_SPEC "%zd" #ifndef L64 #define L64(x) x##LL #endif #endif #define int1store(T,A) do { *((int8_t*) (T)) = (A); } while(0) #define uint1korr(A) (*(((uint8_t*)(A)))) /* Bit values are sent in reverted order of bytes, compared to normal !!! */ #define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((unsigned char*) (A))[1])) +\ ((uint16_t) (((unsigned char*) (A))[0]) << 8))) #define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[2])) +\ (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[0])) << 16))) #define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((unsigned char*) (A))[3])) +\ (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\ (((uint32_t) (((unsigned char*) (A))[0])) << 24))) #define bit_uint5korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[4])) +\ (((uint32_t) (((unsigned char*) (A))[3])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[2])) << 16) +\ (((uint32_t) (((unsigned char*) (A))[1])) << 24)) +\ (((uint64_t) (((unsigned char*) (A))[0])) << 32)) #define bit_uint6korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[5])) +\ (((uint32_t) (((unsigned char*) (A))[4])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[3])) << 16) +\ (((uint32_t) (((unsigned char*) (A))[2])) << 24)) +\ (((uint64_t) (((uint32_t) (((unsigned char*) (A))[1])) +\ (((uint32_t) (((unsigned char*) (A))[0]) << 8)))) <<\ 32)) #define bit_uint7korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[6])) +\ (((uint32_t) (((unsigned char*) (A))[5])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[4])) << 16) +\ (((uint32_t) (((unsigned char*) (A))[3])) << 24)) +\ (((uint64_t) (((uint32_t) (((unsigned char*) (A))[2])) +\ (((uint32_t) (((unsigned char*) (A))[1])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[0])) << 16))) <<\ 32)) #define bit_uint8korr(A) ((uint64_t)(((uint32_t) (((unsigned char*) (A))[7])) +\ (((uint32_t) (((unsigned char*) (A))[6])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[5])) << 16) +\ (((uint32_t) (((unsigned char*) (A))[4])) << 24)) +\ (((uint64_t) (((uint32_t) (((unsigned char*) (A))[3])) +\ (((uint32_t) (((unsigned char*) (A))[2])) << 8) +\ (((uint32_t) (((unsigned char*) (A))[1])) << 16) +\ (((uint32_t) (((unsigned char*) (A))[0])) << 24))) <<\ 32)) /* ** Define-funktions for reading and storing in machine independent format ** (low byte first) */ /* Optimized store functions for Intel x86, non-valid for WIN64. __i386__ is GCC */ #if defined(__i386__) && !defined(_WIN64) #define sint2korr(A) (*((int16_t *) (A))) #define sint3korr(A) ((int32_t) ((((zend_uchar) (A)[2]) & 128) ? \ (((uint32_t) 255L << 24) | \ (((uint32_t) (zend_uchar) (A)[2]) << 16) |\ (((uint32_t) (zend_uchar) (A)[1]) << 8) | \ ((uint32_t) (zend_uchar) (A)[0])) : \ (((uint32_t) (zend_uchar) (A)[2]) << 16) |\ (((uint32_t) (zend_uchar) (A)[1]) << 8) | \ ((uint32_t) (zend_uchar) (A)[0]))) #define sint4korr(A) (*((zend_long *) (A))) #define uint2korr(A) (*((uint16_t *) (A))) #define uint3korr(A) (uint32_t) (((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16)) #define uint4korr(A) (*((zend_ulong *) (A))) #define uint8korr(A) (*((uint64_t *) (A))) #define sint8korr(A) (*((int64_t *) (A))) #define int2store(T,A) *((uint16_t*) (T))= (uint16_t) (A) #define int3store(T,A) { \ *(T)= (zend_uchar) ((A));\ *(T+1)=(zend_uchar) (((uint32_t) (A) >> 8));\ *(T+2)=(zend_uchar) (((A) >> 16)); } #define int4store(T,A) *((zend_long *) (T))= (zend_long) (A) #define int5store(T,A) { \ *((zend_uchar *)(T))= (zend_uchar)((A));\ *(((zend_uchar *)(T))+1)=(zend_uchar) (((A) >> 8));\ *(((zend_uchar *)(T))+2)=(zend_uchar) (((A) >> 16));\ *(((zend_uchar *)(T))+3)=(zend_uchar) (((A) >> 24)); \ *(((zend_uchar *)(T))+4)=(zend_uchar) (((A) >> 32)); } /* From Andrey Hristov, based on int5store() */ #define int6store(T,A) { \ *(((zend_uchar *)(T)))= (zend_uchar)((A));\ *(((zend_uchar *)(T))+1))=(zend_uchar) (((A) >> 8));\ *(((zend_uchar *)(T))+2))=(zend_uchar) (((A) >> 16));\ *(((zend_uchar *)(T))+3))=(zend_uchar) (((A) >> 24)); \ *(((zend_uchar *)(T))+4))=(zend_uchar) (((A) >> 32)); \ *(((zend_uchar *)(T))+5))=(zend_uchar) (((A) >> 40)); } #define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A) typedef union { double v; zend_long m[2]; } float8get_union; #define float8get(V,M) { ((float8get_union *)&(V))->m[0] = *((zend_long*) (M)); \ ((float8get_union *)&(V))->m[1] = *(((zend_long*) (M))+1); } #define float8store(T,V) { *((zend_long *) (T)) = ((float8get_union *)&(V))->m[0]; \ *(((zend_long *) (T))+1) = ((float8get_union *)&(V))->m[1]; } #define float4get(V,M) { *((float *) &(V)) = *((float*) (M)); } /* From Andrey Hristov based on float8get */ #define floatget(V,M) memcpy((char*) &(V),(char*) (M),sizeof(float)) #endif /* __i386__ */ /* If we haven't defined sint2korr, which is because the platform is not x86 or it's WIN64 */ #ifndef sint2korr #define sint2korr(A) (int16_t) (((int16_t) ((zend_uchar) (A)[0])) +\ ((int16_t) ((int16_t) (A)[1]) << 8)) #define sint3korr(A) ((int32_t) ((((zend_uchar) (A)[2]) & 128) ? \ (((uint32_t) 255L << 24) | \ (((uint32_t) (zend_uchar) (A)[2]) << 16) |\ (((uint32_t) (zend_uchar) (A)[1]) << 8) | \ ((uint32_t) (zend_uchar) (A)[0])) : \ (((uint32_t) (zend_uchar) (A)[2]) << 16) |\ (((uint32_t) (zend_uchar) (A)[1]) << 8) | \ ((uint32_t) (zend_uchar) (A)[0]))) #define sint4korr(A) (int32_t) (((int32_t) ((zend_uchar) (A)[0])) +\ (((int32_t) ((zend_uchar) (A)[1]) << 8)) +\ (((int32_t) ((zend_uchar) (A)[2]) << 16)) +\ (((int32_t) ((int16_t) (A)[3]) << 24))) #define sint8korr(A) (int64_t) uint8korr(A) #define uint2korr(A) (uint16_t) (((uint16_t) ((zend_uchar) (A)[0])) +\ ((uint16_t) ((zend_uchar) (A)[1]) << 8)) #define uint3korr(A) (uint32_t) (((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16)) #define uint4korr(A) (uint32_t) (((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ (((uint32_t) ((zend_uchar) (A)[3])) << 24)) #define uint8korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ (((uint32_t) ((zend_uchar) (A)[3])) << 24)) +\ (((uint64_t) (((uint32_t) ((zend_uchar) (A)[4])) +\ (((uint32_t) ((zend_uchar) (A)[5])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[6])) << 16) +\ (((uint32_t) ((zend_uchar) (A)[7])) << 24))) << 32)) #define int2store(T,A) do { uint32_t def_temp= (uint32_t) (A) ;\ *((zend_uchar*) (T)) = (zend_uchar)(def_temp); \ *((zend_uchar*) (T+1)) = (zend_uchar)((def_temp >> 8)); } while (0) #define int3store(T,A) do { /*lint -save -e734 */\ *(((char *)(T))) = (char) ((A));\ *(((char *)(T))+1) = (char) (((A) >> 8));\ *(((char *)(T))+2) = (char) (((A) >> 16)); \ /*lint -restore */} while (0) #define int4store(T,A) do { \ *(((char *)(T))) = (char) ((A));\ *(((char *)(T))+1) = (char) (((A) >> 8));\ *(((char *)(T))+2) = (char) (((A) >> 16));\ *(((char *)(T))+3) = (char) (((A) >> 24)); } while (0) #define int5store(T,A) do { \ *(((char *)(T))) = (char)((A));\ *(((char *)(T))+1) = (char)(((A) >> 8));\ *(((char *)(T))+2) = (char)(((A) >> 16));\ *(((char *)(T))+3) = (char)(((A) >> 24)); \ *(((char *)(T))+4) = (char)(((A) >> 32)); } while (0) /* Based on int5store() from Andrey Hristov */ #define int6store(T,A) do { \ *(((char *)(T))) = (char)((A));\ *(((char *)(T))+1) = (char)(((A) >> 8));\ *(((char *)(T))+2) = (char)(((A) >> 16));\ *(((char *)(T))+3) = (char)(((A) >> 24)); \ *(((char *)(T))+4) = (char)(((A) >> 32)); \ *(((char *)(T))+5) = (char)(((A) >> 40)); } while (0) #define int8store(T,A) { uint32_t def_temp= (uint32_t) (A), def_temp2= (uint32_t) ((A) >> 32); \ int4store((T),def_temp); \ int4store((T+4),def_temp2); \ } #ifdef WORDS_BIGENDIAN #define float4get(V,M) do { float def_temp;\ ((char*) &def_temp)[0] = (M)[3];\ ((char*) &def_temp)[1] = (M)[2];\ ((char*) &def_temp)[2] = (M)[1];\ ((char*) &def_temp)[3] = (M)[0];\ (V)=def_temp; } while (0) #define float8store(T,V) do { \ *(((char *)(T))) = (char) ((char *) &(V))[7];\ *(((char *)(T))+1) = (char) ((char *) &(V))[6];\ *(((char *)(T))+2) = (char) ((char *) &(V))[5];\ *(((char *)(T))+3) = (char) ((char *) &(V))[4];\ *(((char *)(T))+4) = (char) ((char *) &(V))[3];\ *(((char *)(T))+5) = (char) ((char *) &(V))[2];\ *(((char *)(T))+6) = (char) ((char *) &(V))[1];\ *(((char *)(T))+7) = (char) ((char *) &(V))[0]; } while (0) #define float8get(V,M) do { double def_temp;\ ((char*) &def_temp)[0] = (M)[7];\ ((char*) &def_temp)[1] = (M)[6];\ ((char*) &def_temp)[2] = (M)[5];\ ((char*) &def_temp)[3] = (M)[4];\ ((char*) &def_temp)[4] = (M)[3];\ ((char*) &def_temp)[5] = (M)[2];\ ((char*) &def_temp)[6] = (M)[1];\ ((char*) &def_temp)[7] = (M)[0];\ (V) = def_temp; \ } while (0) #else #define float4get(V,M) memcpy((char*) &(V),(char*) (M),sizeof(float)) #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) #define float8store(T,V) do { \ *(((char *)(T)))= ((char *) &(V))[4];\ *(((char *)(T))+1)=(char) ((char *) &(V))[5];\ *(((char *)(T))+2)=(char) ((char *) &(V))[6];\ *(((char *)(T))+3)=(char) ((char *) &(V))[7];\ *(((char *)(T))+4)=(char) ((char *) &(V))[0];\ *(((char *)(T))+5)=(char) ((char *) &(V))[1];\ *(((char *)(T))+6)=(char) ((char *) &(V))[2];\ *(((char *)(T))+7)=(char) ((char *) &(V))[3];} while (0) #define float8get(V,M) do { double def_temp;\ ((char*) &def_temp)[0]=(M)[4];\ ((char*) &def_temp)[1]=(M)[5];\ ((char*) &def_temp)[2]=(M)[6];\ ((char*) &def_temp)[3]=(M)[7];\ ((char*) &def_temp)[4]=(M)[0];\ ((char*) &def_temp)[5]=(M)[1];\ ((char*) &def_temp)[6]=(M)[2];\ ((char*) &def_temp)[7]=(M)[3];\ (V) = def_temp; } while (0) #endif /* __FLOAT_WORD_ORDER */ #endif /* WORDS_BIGENDIAN */ #endif /* sint2korr */ /* To here if the platform is not x86 or it's WIN64 */ /* Define-funktions for reading and storing in machine format from/to short/long to/from some place in memory V should be a (not register) variable, M is a pointer to byte */ #ifndef float8get #ifdef WORDS_BIGENDIAN #define float8get(V,M) memcpy((char*) &(V),(char*) (M), sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V), sizeof(double)) #else #define float8get(V,M) memcpy((char*) &(V),(char*) (M),sizeof(double)) #define float8store(T,V) memcpy((char*) (T),(char*) &(V),sizeof(double)) #endif /* WORDS_BIGENDIAN */ #endif /* float8get */ #endif /* MYSQLND_PORTABILITY_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\}` ) php/ext/mysqlnd/mysqlnd_libmysql_compat.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| | Georg Richter
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_LIBMYSQL_COMPAT_H #define MYSQLND_LIBMYSQL_COMPAT_H /* Global types and definitions*/ #define MYSQL_NO_DATA MYSQLND_NO_DATA #define MYSQL_DATA_TRUNCATED MYSQLND_DATA_TRUNCATED #define MYSQL_STMT MYSQLND_STMT #define MYSQL_FIELD MYSQLND_FIELD #define MYSQL_RES MYSQLND_RES #define MYSQL_ROW MYSQLND_ROW_C #define MYSQL MYSQLND #define my_bool zend_bool #define my_ulonglong uint64_t #define MYSQL_VERSION_ID MYSQLND_VERSION_ID #define MYSQL_SERVER_VERSION PHP_MYSQLND_VERSION #define MYSQL_ERRMSG_SIZE MYSQLND_ERRMSG_SIZE #define SQLSTATE_LENGTH MYSQLND_SQLSTATE_LENGTH /* functions */ #define mysql_affected_rows(r) mysqlnd_affected_rows((r)) #define mysql_autocommit(r,m) mysqlnd_autocommit((r),(m)) #define mysql_change_user(r,a,b,c) mysqlnd_change_user((r), (a), (b), (c), FALSE) #define mysql_character_set_name(c) mysqlnd_character_set_name((c)) #define mysql_close(r) mysqlnd_close((r), MYSQLND_CLOSE_EXPLICIT) #define mysql_commit(r) mysqlnd_commit((r), TRANS_COR_NO_OPT, NULL) #define mysql_data_seek(r,o) mysqlnd_data_seek((r),(o)) #define mysql_debug(x) mysqlnd_debug((x)) #define mysql_dump_debug_info(r) mysqlnd_dump_debug_info((r)) #define mysql_errno(r) mysqlnd_errno((r)) #define mysql_error(r) mysqlnd_error((r)) #define mysql_escape_string(a,b,c) mysqlnd_escape_string((a), (b), (c)) #define mysql_fetch_field(r) mysqlnd_fetch_field((r)) #define mysql_fetch_field_direct(r,o) mysqlnd_fetch_field_direct((r), (o)) #define mysql_fetch_fields(r) mysqlnd_fetch_fields((r)) #define mysql_fetch_lengths(r) mysqlnd_fetch_lengths((r)) #define mysql_fetch_row(r) mysqlnd_fetch_row_c((r)) #define mysql_field_count(r) mysqlnd_field_count((r)) #define mysql_field_seek(r,o) mysqlnd_field_seek((r), (o)) #define mysql_field_tell(r) mysqlnd_field_tell((r)) #define mysql_init(a) mysqlnd_connection_init((a), false) #define mysql_insert_id(r) mysqlnd_insert_id((r)) #define mysql_kill(r,n) mysqlnd_kill((r), (n)) #define mysql_list_dbs(c, wild) mysqlnd_list_dbs((c), (wild)) #define mysql_list_processes(c) mysqlnd_list_processes((c)) #define mysql_list_tables(c, wild) mysqlnd_list_tables((c), (wild)) #define mysql_more_results(r) mysqlnd_more_results((r)) #define mysql_next_result(r) mysqlnd_next_result((r)) #define mysql_num_fields(r) mysqlnd_num_fields((r)) #define mysql_num_rows(r) mysqlnd_num_rows((r)) #define mysql_ping(r) mysqlnd_ping((r)) #define mysql_real_escape_string(r,a,b,c) mysqlnd_real_escape_string((r), (a), (b), (c)) #define mysql_real_query(r,a,b) mysqlnd_query((r), (a), (b)) #define mysql_refresh(conn, options) mysqlnd_refresh((conn), (options)) #define mysql_rollback(r) mysqlnd_rollback((r), TRANS_COR_NO_OPT, NULL) #define mysql_select_db(r,a) mysqlnd_select_db((r), (a) ,strlen((a))) #define mysql_set_server_option(r,o) mysqlnd_set_server_option((r), (o)) #define mysql_set_character_set(r,a) mysqlnd_set_character_set((r), (a)) #define mysql_sqlstate(r) mysqlnd_sqlstate((r)) #define mysql_ssl_set(c,key,cert,ca,capath,cipher) mysqlnd_ssl_set((c), (key), (cert), (ca), (capath), (cipher)) #define mysql_stmt_affected_rows(s) mysqlnd_stmt_affected_rows((s)) #define mysql_stmt_field_count(s) mysqlnd_stmt_field_count((s)) #define mysql_stmt_param_count(s) mysqlnd_stmt_param_count((s)) #define mysql_stmt_num_rows(s) mysqlnd_stmt_num_rows((s)) #define mysql_stmt_insert_id(s) mysqlnd_stmt_insert_id((s)) #define mysql_stmt_close(s) mysqlnd_stmt_close((s)) #define mysql_stmt_bind_param(s,b) mysqlnd_stmt_bind_param((s), (b)) #define mysql_stmt_bind_result(s,b) mysqlnd_stmt_bind_result((s), (b)) #define mysql_stmt_errno(s) mysqlnd_stmt_errno((s)) #define mysql_stmt_error(s) mysqlnd_stmt_error((s)) #define mysql_stmt_sqlstate(s) mysqlnd_stmt_sqlstate((s)) #define mysql_stmt_prepare(s,q,l) mysqlnd_stmt_prepare((s), (q), (l)) #define mysql_stmt_execute(s) mysqlnd_stmt_execute((s)) #define mysql_stmt_reset(s) mysqlnd_stmt_reset((s)) #define mysql_stmt_store_result(s) mysqlnd_stmt_store_result((s)) #define mysql_stmt_free_result(s) mysqlnd_stmt_free_result((s)) #define mysql_stmt_data_seek(s,r) mysqlnd_stmt_data_seek((s), (r)) #define mysql_stmt_send_long_data(s,p,d,l) mysqlnd_stmt_send_long_data((s), (p), (d), (l)) #define mysql_stmt_attr_get(s,a,v) mysqlnd_stmt_attr_get((s), (a), (v)) #define mysql_stmt_attr_set(s,a,v) mysqlnd_stmt_attr_set((s), (a), (v)) #define mysql_stmt_param_metadata(s) mysqlnd_stmt_param_metadata((s)) #define mysql_stmt_result_metadata(s) mysqlnd_stmt_result_metadata((s)) #define mysql_stmt_next_result(s) mysqlnd_stmt_next_result((s)) #define mysql_stmt_more_results(s) mysqlnd_stmt_more_results((s)) #define mysql_thread_safe() mysqlnd_thread_safe() #define mysql_info(r) mysqlnd_info((r)) #define mysql_options(c,a,v) mysqlnd_options((c), (a), (v)) #define mysql_options4(c,a,k,v) mysqlnd_options4((c), (a), (k), (v)) #define mysql_stmt_init(r) mysqlnd_stmt_init((r)) #define mysql_free_result(r) mysqlnd_free_result((r), FALSE) #define mysql_store_result(r) mysqlnd_store_result((r)) #define mysql_use_result(r) mysqlnd_use_result((r)) #define mysql_async_store_result(r) mysqlnd_async_store_result((r)) #define mysql_thread_id(r) mysqlnd_thread_id((r)) #define mysql_get_client_info() mysqlnd_get_client_info() #define mysql_get_client_version() mysqlnd_get_client_version() #define mysql_get_host_info(r) mysqlnd_get_host_info((r)) #define mysql_get_proto_info(r) mysqlnd_get_proto_info((r)) #define mysql_get_server_info(r) mysqlnd_get_server_info((r)) #define mysql_get_server_version(r) mysqlnd_get_server_version((r)) #define mysql_warning_count(r) mysqlnd_warning_count((r)) #define mysql_eof(r) (((r)->unbuf && (r)->unbuf->eof_reached) || (r)->stored_data) #define REFRESH_GRANT MYSQLND_REFRESH_GRANT #define REFRESH_LOG MYSQLND_REFRESH_LOG #define REFRESH_TABLES MYSQLND_REFRESH_TABLES #define REFRESH_HOSTS MYSQLND_REFRESH_HOSTS #define REFRESH_STATUS MYSQLND_REFRESH_STATUS #define REFRESH_THREADS MYSQLND_REFRESH_THREADS #define REFRESH_SLAVE MYSQLND_REFRESH_SLAVE #define REFRESH_MASTER MYSQLND_REFRESH_MASTER #define REFRESH_BACKUP_LOG MYSQLND_REFRESH_BACKUP_LOG #endif /* MYSQLND_LIBMYSQL_COMPAT_H */ PK "\Q Q php/ext/mysqlnd/mysqlnd_plugin.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_PLUGIN_H #define MYSQLND_PLUGIN_H void mysqlnd_plugin_subsystem_init(void); void mysqlnd_plugin_subsystem_end(void); void mysqlnd_register_builtin_authentication_plugins(void); void mysqlnd_example_plugin_register(void); #endif /* MYSQLND_PLUGIN_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\ php/ext/mysqlnd/mysqlnd_result.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_RESULT_H #define MYSQLND_RESULT_H PHPAPI MYSQLND_RES * mysqlnd_result_init(const unsigned int field_count, const zend_bool persistent); PHPAPI MYSQLND_RES_UNBUFFERED * mysqlnd_result_unbuffered_init(const unsigned int field_count, const zend_bool ps, const zend_bool persistent); PHPAPI MYSQLND_RES_BUFFERED_ZVAL * mysqlnd_result_buffered_zval_init(const unsigned int field_count, const zend_bool ps, const zend_bool persistent); PHPAPI MYSQLND_RES_BUFFERED_C * mysqlnd_result_buffered_c_init(const unsigned int field_count, const zend_bool ps, const zend_bool persistent); enum_func_status mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * stmt); #endif /* MYSQLND_RESULT_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\ php/ext/mysqlnd/php_mysqlnd.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| +----------------------------------------------------------------------+ */ #ifndef PHP_MYSQLND_H #define PHP_MYSQLND_H #define phpext_mysqlnd_ptr &mysqlnd_module_entry extern zend_module_entry mysqlnd_module_entry; #endif /* PHP_MYSQLND_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\~cL[f f php/ext/mysqlnd/mysqlnd_priv.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_PRIV_H #define MYSQLND_PRIV_H PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_object_factory); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_conn_data); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_res); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_unbuffered); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_buffered); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol_payload_decoder_factory); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol_packet_frame_codec); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_vio); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_upsert_status); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_error_info); enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * const filename, zend_bool * is_warning); #endif /* MYSQLND_PRIV_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\r php/ext/mysqlnd/mysqlnd_vio.hnu [ /* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 2006-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Andrey Hristov
| | Ulf Wendel
| +----------------------------------------------------------------------+ */ #ifndef MYSQLND_VIO_H #define MYSQLND_VIO_H PHPAPI MYSQLND_VIO * mysqlnd_vio_init(zend_bool persistent, MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *object_factory, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info); PHPAPI void mysqlnd_vio_free(MYSQLND_VIO * const vio, MYSQLND_STATS * stats, MYSQLND_ERROR_INFO * error_info); #endif /* MYSQLND_VIO_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\j php/ext/mysqlnd/config-win.hnu [ /* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB This file is public domain and comes with NO WARRANTY of any kind */ /* Defines for Win32 to make it compatible for MySQL */ #ifndef _MYSQLND_CONFIG_WIN_H #define _MYSQLND_CONFIG_WIN_H #include
#include
#include
/* Because of rint() */ #include
#include
#include
#include
#ifndef HAVE_INT8_T #define HAVE_INT8_T #endif #ifndef HAVE_UINT8_T #define HAVE_UINT8_T #endif #ifndef HAVE_INT16_T #define HAVE_INT16_T #endif #ifndef HAVE_UINT16_T #define HAVE_UINT16_T #endif #ifndef HAVE_INT32_T #define HAVE_INT32_T #endif #ifndef HAVE_UINT32_T #define HAVE_UINT32_T #endif #ifndef HAVE_INT64_T #define HAVE_INT64_T #endif #ifndef HAVE_UINT64_T #define HAVE_UINT64_T #endif #ifndef _WIN64 #ifndef _WIN32 #define _WIN32 /* Compatible with old source */ #endif #ifndef __WIN32__ #define __WIN32__ #endif #endif /* _WIN64 */ #ifndef __WIN__ #define __WIN__ /* To make it easier in VC++ */ #endif /* Type information */ #define SIZEOF_CHAR 1 #define SIZEOF_LONG 4 #define SIZEOF_LONG_LONG 8 #ifndef _WIN64 /* Optimized store functions for Intel x86 */ #define sint2korr(A) (*((int16_t *) (A))) #define sint3korr(A) ((int32_t) ((((zend_uchar) (A)[2]) & 128) ? \ (((uint32_t) 255L << 24) | \ (((uint32_t) (zend_uchar) (A)[2]) << 16) |\ (((uint32_t) (zend_uchar) (A)[1]) << 8) | \ ((uint32_t) (zend_uchar) (A)[0])) : \ (((uint32_t) (zend_uchar) (A)[2]) << 16) |\ (((uint32_t) (zend_uchar) (A)[1]) << 8) | \ ((uint32_t) (zend_uchar) (A)[0]))) #define sint4korr(A) (*((int32_t *) (A))) #define uint2korr(A) (*((uint16_t *) (A))) #define uint3korr(A) (int32_t) (*((uint32_t *) (A)) & 0xFFFFFF) #define uint4korr(A) (*((uint32_t *) (A))) #define uint5korr(A) ((uint64_t)(((uint32_t) ((zend_uchar) (A)[0])) +\ (((uint32_t) ((zend_uchar) (A)[1])) << 8) +\ (((uint32_t) ((zend_uchar) (A)[2])) << 16) +\ (((uint32_t) ((zend_uchar) (A)[3])) << 24)) +\ (((uint64_t) ((zend_uchar) (A)[4])) << 32)) #define uint8korr(A) (*((uint64_t *) (A))) #define sint8korr(A) (*((int64_t *) (A))) #define int2store(T,A) *((uint16_t*) (T))= (uint16_t) (A) #define int3store(T,A) { *(T)= (zend_uchar) ((A));\ *(T+1)=(zend_uchar) (((uint32_t) (A) >> 8));\ *(T+2)=(zend_uchar) (((A) >> 16)); } #define int4store(T,A) *((int32_t *) (T))= (int32_t) (A) #define int5store(T,A) { *(T)= (zend_uchar)((A));\ *((T)+1)=(zend_uchar) (((A) >> 8));\ *((T)+2)=(zend_uchar) (((A) >> 16));\ *((T)+3)=(zend_uchar) (((A) >> 24)); \ *((T)+4)=(zend_uchar) (((A) >> 32)); } #define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A) #define float8get(V,M) { *((int32_t *) &V) = *((int32_t*) M); \ *(((int32_t *) &V)+1) = *(((int32_t*) M)+1); } #define float8store(T,V) { *((int32_t *) T) = *((int32_t*) &V); \ *(((int32_t *) T)+1) = *(((int32_t*) &V)+1); } #define float4get(V,M) { *((int32_t *) &(V)) = *((int32_t*) (M)); } #endif /* _WIN64 */ #endif /* _MYSQLND_CONFIG_WIN_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */ PK "\:4^' ^' &