diff options
Diffstat (limited to 'ext/json/php_json.h')
-rw-r--r-- | ext/json/php_json.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/json/php_json.h b/ext/json/php_json.h index 4e61ae45e9..992f42c087 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -22,7 +22,7 @@ #ifndef PHP_JSON_H #define PHP_JSON_H -#define PHP_JSON_VERSION "1.4.0" +#define PHP_JSON_VERSION "1.5.0" #include "zend_smart_str_public.h" extern zend_module_entry json_module_entry; @@ -67,6 +67,7 @@ typedef enum { #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_UNESCAPED_LINE_TERMINATORS (1<<11) /* json_decode() options */ #define PHP_JSON_OBJECT_AS_ARRAY (1<<0) @@ -92,12 +93,12 @@ PHP_JSON_API ZEND_EXTERN_MODULE_GLOBALS(json) ZEND_TSRMLS_CACHE_EXTERN() #endif -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); +PHP_JSON_API int php_json_encode(smart_str *buf, zval *val, int options); +PHP_JSON_API int php_json_decode_ex(zval *return_value, char *str, size_t str_len, zend_long options, zend_long depth); -static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth) +static inline int php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, zend_long depth) { - php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth); + return php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth); } |