46 return c ==
' ' ||
c ==
'\t' ||
c ==
'\n' ||
c ==
'\r';
76 while(*
ctx->ptr && *
ctx->ptr !=
'"') {
77 if(*
ctx->ptr++ ==
'\\')
81 FIXME(
"unterminated string\n");
93 FIXME(
"unescape failed\n");
155 FIXME(
"missing ':'\n");
176 if(*
ctx->ptr++ !=
',') {
177 FIXME(
"expected ','\n");
239 if(*
ctx->ptr !=
',') {
240 FIXME(
"expected ','\n");
257 if(*
ctx->ptr ==
'-') {
289 FIXME(
"Unsupported args\n");
308 FIXME(
"syntax error\n");
336 if(!
ctx->stack_size) {
341 }
else if(
ctx->stack_top ==
ctx->stack_size) {
347 ctx->stack = new_stack;
348 ctx->stack_size *= 2;
362 size_t i =
ctx->stack_top;
377 }
else if(
ctx->buf_len +
len >
ctx->buf_size) {
381 new_size =
ctx->buf_size * 2 +
len;
386 ctx->buf_size = new_size;
482 static const WCHAR formatW[] = {
'\\',
'u',
'%',
'0',
'4',
'x',0};
513 FIXME(
"Found a cycle\n");
533 for(
j=0;
j <
ctx->stack_top;
j++) {
564 DISPID dispid = DISPID_STARTENUM;
566 unsigned prop_cnt = 0,
i;
572 FIXME(
"Found a cycle\n");
582 while((
hres = IDispatchEx_GetNextDispID(&
obj->IDispatchEx_iface, fdexEnumDefault, dispid, &dispid)) ==
S_OK) {
591 stepback =
ctx->buf_len;
604 for(
i=0;
i <
ctx->stack_top;
i++) {
612 hres = IDispatchEx_GetMemberName(&
obj->IDispatchEx_iface, dispid, &prop_name);
631 ctx->buf_len = stepback;
641 if(prop_cnt && *
ctx->gap) {
645 for(
i=1;
i <
ctx->stack_top;
i++) {
677 FIXME(
"Use toJSON.\n");
789 stringify_ctx.
gap[
i] =
' ';
790 stringify_ctx.
gap[
len] = 0;
842 json = heap_alloc_zero(
sizeof(*json));
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
HRESULT create_array(script_ctx_t *ctx, DWORD length, jsdisp_t **ret)
unsigned array_get_length(jsdisp_t *array)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
BOOL bool_obj_value(jsdisp_t *obj)
static BOOL get_bool(D3DXPARAMETER_TYPE type, const void *data)
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static HRESULT to_string(VARIANT *src, BSTR *dst)
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
HRESULT jsdisp_propput_name(jsdisp_t *obj, const WCHAR *name, jsval_t val)
HRESULT jsdisp_get_id(jsdisp_t *jsdisp, const WCHAR *name, DWORD flags, DISPID *id)
HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *constr)
jsdisp_t * iface_to_jsdisp(IDispatch *iface)
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, jsval_t *val)
HRESULT parse_decimal(const WCHAR **iter, const WCHAR *end, double *ret)
BOOL unescape(WCHAR *str, size_t *len)
BOOL is_identifier_char(WCHAR c)
HRESULT create_object(script_ctx_t *, jsdisp_t *, jsdisp_t **) DECLSPEC_HIDDEN
static void jsdisp_release(jsdisp_t *jsdisp)
HRESULT to_number(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
HRESULT double_to_string(double, jsstr_t **) DECLSPEC_HIDDEN
BOOL is_finite(double) DECLSPEC_HIDDEN
const char * debugstr_jsval(const jsval_t) DECLSPEC_HIDDEN
HRESULT to_flat_string(script_ctx_t *, jsval_t, jsstr_t **, const WCHAR **) DECLSPEC_HIDDEN
static BOOL is_class(jsdisp_t *jsdisp, jsclass_t class)
static HRESULT maybe_to_primitive(script_ctx_t *ctx, jsval_t val, jsval_t *r)
static BOOL is_keyword(json_parse_ctx_t *ctx, const WCHAR *keyword)
static const builtin_prop_t JSON_props[]
static BOOL append_string(stringify_ctx_t *ctx, const WCHAR *str)
static const WCHAR toJSONW[]
static const WCHAR falseW[]
static const WCHAR trueW[]
static const WCHAR stringifyW[]
static HRESULT stringify(stringify_ctx_t *ctx, jsval_t val)
static void stringify_pop_obj(stringify_ctx_t *ctx)
static BOOL is_json_space(WCHAR c)
HRESULT create_json(script_ctx_t *ctx, jsdisp_t **ret)
static const WCHAR parseW[]
static BOOL append_string_len(stringify_ctx_t *ctx, const WCHAR *str, size_t len)
static HRESULT stringify_array(stringify_ctx_t *ctx, jsdisp_t *obj)
static BOOL append_simple_quote(stringify_ctx_t *ctx, WCHAR c)
static const builtin_info_t JSON_info
static BOOL stringify_push_obj(stringify_ctx_t *ctx, jsdisp_t *obj)
static HRESULT stringify_object(stringify_ctx_t *ctx, jsdisp_t *obj)
static BOOL is_callable(jsdisp_t *obj)
static BOOL append_char(stringify_ctx_t *ctx, WCHAR c)
static HRESULT JSON_parse(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static HRESULT JSON_stringify(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static const WCHAR nullW[]
static HRESULT parse_json_string(json_parse_ctx_t *ctx, WCHAR **r)
static WCHAR skip_spaces(json_parse_ctx_t *ctx)
static HRESULT parse_json_value(json_parse_ctx_t *ctx, jsval_t *r)
static HRESULT json_quote(stringify_ctx_t *ctx, const WCHAR *ptr, size_t len)
static BOOL is_on_stack(stringify_ctx_t *ctx, jsdisp_t *obj)
jsstr_t * jsstr_alloc_len(const WCHAR *buf, unsigned len)
void jsstr_extract(jsstr_t *str, unsigned off, unsigned len, WCHAR *buf)
static const WCHAR * jsstr_flatten(jsstr_t *str)
static void jsstr_release(jsstr_t *str)
static unsigned jsstr_length(jsstr_t *str)
static jsstr_t * jsstr_alloc(const WCHAR *str)
HRESULT jsval_copy(jsval_t v, jsval_t *r)
void jsval_release(jsval_t val)
static BOOL is_number(jsval_t v)
static jsval_t jsval_null(void)
static jsval_t jsval_string(jsstr_t *str)
static jsval_t jsval_undefined(void)
static jsval_t jsval_obj(jsdisp_t *obj)
static jsval_t jsval_bool(BOOL b)
static jsval_type_t jsval_type(jsval_t v)
static jsstr_t * get_string(jsval_t v)
static BOOL is_undefined(jsval_t v)
static double get_number(jsval_t v)
static IDispatch * get_object(jsval_t v)
static BOOL is_object_instance(jsval_t v)
static jsval_t jsval_number(double n)
#define memcpy(s1, s2, n)
static VARIANTARG static DISPID
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
static BOOL is_string(parse_buffer *buf)
#define DISP_E_UNKNOWNNAME