summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-07-23 12:24:52 +0000
committerAntony Dovgal <tony2001@php.net>2007-07-23 12:24:52 +0000
commit17ee976404e8af58b96ad56af7878720df0de676 (patch)
treec2d9537042eb4a2914e568a19f9c380b6ea87101 /ext/json
parent5b71d45effbaeba3c132c7025bbfd0c5fae7f638 (diff)
downloadphp-git-17ee976404e8af58b96ad56af7878720df0de676.tar.gz
fix ws/folding
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/json.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/json/json.c b/ext/json/json.c
index 56507a2cbc..5044f50b34 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -86,7 +86,8 @@ static PHP_MINFO_FUNCTION(json)
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 @@ static int json_determine_array_type(zval **val TSRMLS_DC) {
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 @@ static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) {
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 @@ static void json_escape_string(smart_str *buf, char *s, int len)
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 @@ static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC) {
return;
}
+/* }}} */
/* {{{ proto string json_encode(mixed data)
Returns the JSON representation of a value */