tony2001 Thu Oct 19 10:12:19 2006 UTC Modified files: /php-src/ext/json json.c php_json.h Log: fix folding tags, nuke json globals http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.17&r2=1.18&diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.17 php-src/ext/json/json.c:1.18 --- php-src/ext/json/json.c:1.17 Thu Oct 19 10:01:54 2006 +++ php-src/ext/json/json.c Thu Oct 19 10:12:19 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: json.c,v 1.17 2006/10/19 10:01:54 tony2001 Exp $ */ +/* $Id: json.c,v 1.18 2006/10/19 10:12:19 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -30,9 +30,6 @@ #include "JSON_parser.h" #include "php_json.h" -/* If you declare any globals in php_json.h uncomment this: -ZEND_DECLARE_MODULE_GLOBALS(json) -*/ static const char digits[] = "0123456789abcdef"; /* {{{ json_functions[] @@ -84,7 +81,8 @@ static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC); static void json_escape_string(smart_str *buf, zstr s, int len, zend_uchar type); -static int json_determine_array_type(zval **val TSRMLS_DC) { +static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */ +{ int i; HashTable *myht; @@ -122,8 +120,10 @@ return 0; } +/* }}} */ -static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) { +static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) /* {{{ */ +{ int i, r; HashTable *myht; @@ -230,10 +230,11 @@ smart_str_appendc(buf, '}'); } } +/* }}} */ #define REVERSE16(us) (((us & 0xf) << 12) | (((us >> 4) & 0xf) << 8) | (((us >> 8) & 0xf) << 4) | ((us >> 12) & 0xf)) -static void json_escape_string(smart_str *buf, zstr s, int len, zend_uchar type) +static void json_escape_string(smart_str *buf, zstr s, int len, zend_uchar type) /* {{{ */ { int pos = 0; unsigned short us; @@ -341,8 +342,10 @@ efree(utf16); } } +/* }}} */ -static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC) { +static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC) /* {{{ */ +{ switch (Z_TYPE_P(val)) { case IS_NULL: smart_str_appendl(buf, "null", 4); @@ -398,6 +401,7 @@ return; } +/* }}} */ /* {{{ proto string json_encode(mixed data) U Returns the JSON representation of a value */ @@ -416,6 +420,7 @@ smart_str_free(&buf); } +/* }}} */ /* {{{ proto mixed json_decode(string json [, bool assoc]) U Decodes the JSON representation into a PHP value */ @@ -525,6 +530,7 @@ } } } +/* }}} */ /* * Local variables: http://cvs.php.net/viewvc.cgi/php-src/ext/json/php_json.h?r1=1.8&r2=1.9&diff_format=u Index: php-src/ext/json/php_json.h diff -u php-src/ext/json/php_json.h:1.8 php-src/ext/json/php_json.h:1.9 --- php-src/ext/json/php_json.h:1.8 Sat Mar 18 04:15:16 2006 +++ php-src/ext/json/php_json.h Thu Oct 19 10:12:19 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_json.h,v 1.8 2006/03/18 04:15:16 omar Exp $ */ +/* $Id: php_json.h,v 1.9 2006/10/19 10:12:19 tony2001 Exp $ */ #ifndef PHP_JSON_H #define PHP_JSON_H @@ -41,15 +41,8 @@ PHP_FUNCTION(json_encode); PHP_FUNCTION(json_decode); -#ifdef ZTS -#define JSON_G(v) TSRMG(json_globals_id, zend_json_globals *, v) -#else -#define JSON_G(v) (json_globals.v) -#endif - #endif /* PHP_JSON_H */ - /* * Local variables: * tab-width: 4
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php