#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[]
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;
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;
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;
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);
return;
}
+/* }}} */
/* {{{ proto string json_encode(mixed data) U
Returns the JSON representation of a value */
smart_str_free(&buf);
}
+/* }}} */
/* {{{ proto mixed json_decode(string json [, bool assoc]) U
Decodes the JSON representation into a PHP value */
}
}
}
+/* }}} */
/*
* Local variables: