diff options
author | portix <none@none> | 2012-04-29 13:09:56 +0200 |
---|---|---|
committer | portix <none@none> | 2012-04-29 13:09:56 +0200 |
commit | 3b75a96b57033f35f2e2aa983319760f9ce01f79 (patch) | |
tree | 21c0c7791fceaadf96dbea4144e31b11e3e31fe0 /src/js.c | |
parent | 1ee05fad020a5af499d0283273af4cb4f9c13d2b (diff) | |
download | dwb-3b75a96b57033f35f2e2aa983319760f9ce01f79.zip |
Get gobject properties from scripts; started rewriting of documentation
--HG--
branch : scripts
Diffstat (limited to 'src/js.c')
-rw-r--r-- | src/js.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -201,3 +201,16 @@ js_value_to_char(JSContextRef ctx, JSValueRef value, size_t limit, JSValueRef *e JSStringRelease(jsstring); return ret; }/*}}}*/ + +char * +js_value_to_json(JSContextRef ctx, JSValueRef value, size_t limit, JSValueRef *exc) { + if (value == NULL) + return NULL; + JSStringRef js_json = JSValueCreateJSONString(ctx, value, 2, exc); + if (js_json == NULL) + return NULL; + char *json = js_string_to_char(ctx, js_json, limit); + JSStringRelease(js_json); + return json; +} + |