summaryrefslogtreecommitdiff
path: root/ext/json/php_json.h
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2016-06-10 22:02:23 -0500
committerAaron Piotrowski <aaron@trowski.com>2016-06-10 22:02:23 -0500
commite3c681aa5cc71122a8d2fae42e6513fc413ccac8 (patch)
tree5f1df62f7b666028edb0ee1adf083a52d63df45a /ext/json/php_json.h
parentfb4e3085cbaa76eb8f28eebf848a81d1c0190067 (diff)
parent792e89385ca6fc722a03590722eb7745a2374720 (diff)
downloadphp-git-e3c681aa5cc71122a8d2fae42e6513fc413ccac8.tar.gz
Merge branch 'master' into throw-error-in-extensions
Diffstat (limited to 'ext/json/php_json.h')
-rw-r--r--ext/json/php_json.h43
1 files changed, 20 insertions, 23 deletions
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index c47bc0f401..d1fabd1e6b 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
+ | Copyright (c) 1997-2016 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 |
@@ -56,17 +56,22 @@ typedef enum {
} php_json_error_code;
/* json_encode() options */
-#define PHP_JSON_HEX_TAG (1<<0)
-#define PHP_JSON_HEX_AMP (1<<1)
-#define PHP_JSON_HEX_APOS (1<<2)
-#define PHP_JSON_HEX_QUOT (1<<3)
-#define PHP_JSON_FORCE_OBJECT (1<<4)
-#define PHP_JSON_NUMERIC_CHECK (1<<5)
-#define PHP_JSON_UNESCAPED_SLASHES (1<<6)
-#define PHP_JSON_PRETTY_PRINT (1<<7)
-#define PHP_JSON_UNESCAPED_UNICODE (1<<8)
+#define PHP_JSON_HEX_TAG (1<<0)
+#define PHP_JSON_HEX_AMP (1<<1)
+#define PHP_JSON_HEX_APOS (1<<2)
+#define PHP_JSON_HEX_QUOT (1<<3)
+#define PHP_JSON_FORCE_OBJECT (1<<4)
+#define PHP_JSON_NUMERIC_CHECK (1<<5)
+#define PHP_JSON_UNESCAPED_SLASHES (1<<6)
+#define PHP_JSON_PRETTY_PRINT (1<<7)
+#define PHP_JSON_UNESCAPED_UNICODE (1<<8)
#define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR (1<<9)
-#define PHP_JSON_PRESERVE_ZERO_FRACTION (1<<10)
+#define PHP_JSON_PRESERVE_ZERO_FRACTION (1<<10)
+#define PHP_JSON_UNESCAPED_LINE_TERMINATORS (1<<11)
+
+/* json_decode() options */
+#define PHP_JSON_OBJECT_AS_ARRAY (1<<0)
+#define PHP_JSON_BIGINT_AS_STRING (1<<1)
/* Internal flags */
#define PHP_JSON_OUTPUT_ARRAY 0
@@ -81,21 +86,13 @@ ZEND_BEGIN_MODULE_GLOBALS(json)
php_json_error_code error_code;
ZEND_END_MODULE_GLOBALS(json)
-ZEND_EXTERN_MODULE_GLOBALS(json);
+PHP_JSON_API ZEND_EXTERN_MODULE_GLOBALS(json)
+#define JSON_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(json, v)
-#ifdef ZTS
-# define JSON_G(v) ZEND_TSRMG(json_globals_id, zend_json_globals *, v)
-# ifdef COMPILE_DL_JSON
-ZEND_TSRMLS_CACHE_EXTERN;
-# endif
-#else
-# define JSON_G(v) (json_globals.v)
+#if defined(ZTS) && defined(COMPILE_DL_JSON)
+ZEND_TSRMLS_CACHE_EXTERN()
#endif
-/* json_decode() options */
-#define PHP_JSON_OBJECT_AS_ARRAY (1<<0)
-#define PHP_JSON_BIGINT_AS_STRING (1<<1)
-
PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options);
PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth);