cvs: php-src(PHP_5_2) /ext/json json.c

From: Date: Mon, 23 Jul 2007 12:24:52 +0000
Subject: cvs: php-src(PHP_5_2) /ext/json json.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-45542@lists.php.net to get a copy of this message
tony2001 Mon Jul 23 12:24:52 2007 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/json json.c Log: fix ws/folding http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.17&r2=1.9.2.18&diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.9.2.17 php-src/ext/json/json.c:1.9.2.18 --- php-src/ext/json/json.c:1.9.2.17 Wed Jun 13 17:07:58 2007 +++ php-src/ext/json/json.c Mon Jul 23 12:24:52 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: json.c,v 1.9.2.17 2007/06/13 17:07:58 iliaa Exp $ */ +/* $Id: json.c,v 1.9.2.18 2007/07/23 12:24:52 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -86,7 +86,8 @@ static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC); static void json_escape_string(smart_str *buf, char *s, int len); -static int json_determine_array_type(zval **val TSRMLS_DC) { +static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */ +{ int i; HashTable *myht = HASH_OF(*val); @@ -117,8 +118,9 @@ 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; @@ -224,10 +226,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, char *s, int len) +static void json_escape_string(smart_str *buf, char *s, int len) /* {{{ */ { int pos = 0; unsigned short us; @@ -328,8 +331,10 @@ smart_str_appendc(buf, '"'); 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); @@ -378,6 +383,7 @@ return; } +/* }}} */ /* {{{ proto string json_encode(mixed data) Returns the JSON representation of a value */

« previous php.cvs (#45542) next »