Fossil SCM
Added json_new_int() convenience function.
Commit
ccd66b9b3ca479707288cd04962917cf71845582
Parent
6372d9516554a5e…
1 file changed
+4
+4
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -356,10 +356,14 @@ | ||
| 356 | 356 | cson_value * json_new_string( char const * str ){ |
| 357 | 357 | return str |
| 358 | 358 | ? cson_value_new_string(str,strlen(str)) |
| 359 | 359 | : NULL; |
| 360 | 360 | } |
| 361 | + | |
| 362 | +cson_value * json_new_int( int v ){ | |
| 363 | + return cson_value_new_integer((cson_int_t)v); | |
| 364 | +} | |
| 361 | 365 | |
| 362 | 366 | /* |
| 363 | 367 | ** Gets a POST/POST.payload/GET/COOKIE/ENV value. The returned memory |
| 364 | 368 | ** is owned by the g.json object (one of its sub-objects). Returns |
| 365 | 369 | ** NULL if no match is found. |
| 366 | 370 |
| --- 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 |