Fossil SCM

Added json_new_int() convenience function.

stephan 2011-10-01 05:57 UTC json
Commit ccd66b9b3ca479707288cd04962917cf71845582
1 file changed +4
+4
--- src/json.c
+++ src/json.c
@@ -356,10 +356,14 @@
356356
cson_value * json_new_string( char const * str ){
357357
return str
358358
? cson_value_new_string(str,strlen(str))
359359
: NULL;
360360
}
361
+
362
+cson_value * json_new_int( int v ){
363
+ return cson_value_new_integer((cson_int_t)v);
364
+}
361365
362366
/*
363367
** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory
364368
** is owned by the g.json object (one of its sub-objects). Returns
365369
** NULL if no match is found.
366370
--- src/json.c
+++ src/json.c
@@ -356,10 +356,14 @@
356 cson_value * json_new_string( char const * str ){
357 return str
358 ? cson_value_new_string(str,strlen(str))
359 : NULL;
360 }
 
 
 
 
361
362 /*
363 ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory
364 ** is owned by the g.json object (one of its sub-objects). Returns
365 ** NULL if no match is found.
366
--- src/json.c
+++ src/json.c
@@ -356,10 +356,14 @@
356 cson_value * json_new_string( char const * str ){
357 return str
358 ? cson_value_new_string(str,strlen(str))
359 : NULL;
360 }
361
362 cson_value * json_new_int( int v ){
363 return cson_value_new_integer((cson_int_t)v);
364 }
365
366 /*
367 ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory
368 ** is owned by the g.json object (one of its sub-objects). Returns
369 ** NULL if no match is found.
370

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button