Back to index

php5  5.3.10
php_json.h
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Author: Omar Kilani <omar@php.net>                                   |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_json.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_JSON_H
00022 #define PHP_JSON_H
00023 
00024 #define PHP_JSON_VERSION "1.2.1"
00025 #include "ext/standard/php_smart_str.h"
00026 
00027 extern zend_module_entry json_module_entry;
00028 #define phpext_json_ptr &json_module_entry
00029 
00030 #if defined(PHP_WIN32) && defined(JSON_EXPORTS)
00031 #define PHP_JSON_API __declspec(dllexport)
00032 #else
00033 #define PHP_JSON_API PHPAPI
00034 #endif
00035 
00036 #ifdef ZTS
00037 #include "TSRM.h"
00038 #endif
00039 
00040 ZEND_BEGIN_MODULE_GLOBALS(json)
00041        int error_code;
00042 ZEND_END_MODULE_GLOBALS(json)
00043 
00044 #ifdef ZTS
00045 # define JSON_G(v) TSRMG(json_globals_id, zend_json_globals *, v)
00046 #else
00047 # define JSON_G(v) (json_globals.v)
00048 #endif
00049 
00050 PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC);
00051 PHP_JSON_API void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, long depth TSRMLS_DC);
00052 
00053 #define PHP_JSON_HEX_TAG    (1<<0)
00054 #define PHP_JSON_HEX_AMP    (1<<1)
00055 #define PHP_JSON_HEX_APOS   (1<<2)
00056 #define PHP_JSON_HEX_QUOT   (1<<3)
00057 #define PHP_JSON_FORCE_OBJECT      (1<<4)
00058 #define PHP_JSON_NUMERIC_CHECK     (1<<5)
00059 
00060 #define PHP_JSON_OUTPUT_ARRAY 0
00061 #define PHP_JSON_OUTPUT_OBJECT 1
00062 
00063 #endif  /* PHP_JSON_H */
00064 
00065 /*
00066  * Local variables:
00067  * tab-width: 4
00068  * c-basic-offset: 4
00069  * End:
00070  * vim600: noet sw=4 ts=4 fdm=marker
00071  * vim<600: noet sw=4 ts=4
00072  */