Fossil SCM

Doc changes only

stephan 2011-09-17 23:14 UTC json
Commit 5a9e567966c25502bbc77573263d4933a237ed8b
1 file changed +17 -3
+17 -3
--- src/json.c
+++ src/json.c
@@ -13,16 +13,23 @@
1313
** [email protected]
1414
** http://www.hwaci.com/drh/
1515
**
1616
*******************************************************************************
1717
**
18
-** Code for the JSON/REST API.
18
+** Code for the JSON API.
1919
**
2020
** For notes regarding the public JSON interface, please see:
2121
**
2222
** https://docs.google.com/document/d/1fXViveNhDbiXgCuE7QDXQOKeFzf2qNUkBEgiUvoqFN4/edit
2323
**
24
+**
25
+** Notable FIXMEs:
26
+**
27
+** - The overlap between cson_cgi and fossil needs to be gotten rid
28
+** of because cson_cgi cannot get all the environment info it needs
29
+** when fossil is running in server mode. The goal is to remove all
30
+** of the cson_cgi bits.
2431
*/
2532
#include "config.h"
2633
#include "VERSION.h"
2734
#include "json.h"
2835
#include <assert.h>
@@ -344,10 +351,16 @@
344351
** position of the "json" part of the path. Returns NULL if ndx is out
345352
** of bounds or there is no "json" path element.
346353
**
347354
** In CLI mode the "path" is the list of arguments (skipping argv[0]).
348355
** In server/CGI modes the path is taken from PATH_INFO.
356
+**
357
+**
358
+** Reminder to self: this breaks in CLI mode when called with an
359
+** abbreviated name because we rely on the full name "json" here. The
360
+** g object probably has the short form which we can use for our
361
+** purposes, but i haven't yet looked for it.
349362
*/
350363
static char const * json_command_arg(unsigned char ndx){
351364
cson_array * ar = cson_value_get_array(
352365
cson_cgi_getenv(&g.json.cgiCx,
353366
"a",
@@ -475,18 +488,19 @@
475488
476489
}
477490
#endif
478491
479492
/*
480
-** Creates a new Fossil/REST response envelope skeleton. It is owned
493
+** Creates a new Fossil/JSON response envelope skeleton. It is owned
481494
** by the caller, who must eventually free it using cson_value_free(),
482495
** or add it to a cson container to transfer ownership. Returns NULL
483496
** on error.
484497
**
485498
** If payload is not NULL and resultCode is 0 then it is set as the
486499
** "payload" property of the returned object. If resultCode is non-0
487
-** then this function will destroy payload if it is not NULL.
500
+** then this function will destroy payload if it is not NULL. i.e.
501
+** onwership of payload is transfered to this function.
488502
**
489503
** pMsg is an optional message string (resultText) property of the
490504
** response. If resultCode is non-0 and pMsg is NULL then
491505
** json_err_str() is used to get the error string. The caller may
492506
** provide his own or may use an empty string to suppress the
493507
--- src/json.c
+++ src/json.c
@@ -13,16 +13,23 @@
13 ** [email protected]
14 ** http://www.hwaci.com/drh/
15 **
16 *******************************************************************************
17 **
18 ** Code for the JSON/REST API.
19 **
20 ** For notes regarding the public JSON interface, please see:
21 **
22 ** https://docs.google.com/document/d/1fXViveNhDbiXgCuE7QDXQOKeFzf2qNUkBEgiUvoqFN4/edit
23 **
 
 
 
 
 
 
 
24 */
25 #include "config.h"
26 #include "VERSION.h"
27 #include "json.h"
28 #include <assert.h>
@@ -344,10 +351,16 @@
344 ** position of the "json" part of the path. Returns NULL if ndx is out
345 ** of bounds or there is no "json" path element.
346 **
347 ** In CLI mode the "path" is the list of arguments (skipping argv[0]).
348 ** In server/CGI modes the path is taken from PATH_INFO.
 
 
 
 
 
 
349 */
350 static char const * json_command_arg(unsigned char ndx){
351 cson_array * ar = cson_value_get_array(
352 cson_cgi_getenv(&g.json.cgiCx,
353 "a",
@@ -475,18 +488,19 @@
475
476 }
477 #endif
478
479 /*
480 ** Creates a new Fossil/REST response envelope skeleton. It is owned
481 ** by the caller, who must eventually free it using cson_value_free(),
482 ** or add it to a cson container to transfer ownership. Returns NULL
483 ** on error.
484 **
485 ** If payload is not NULL and resultCode is 0 then it is set as the
486 ** "payload" property of the returned object. If resultCode is non-0
487 ** then this function will destroy payload if it is not NULL.
 
488 **
489 ** pMsg is an optional message string (resultText) property of the
490 ** response. If resultCode is non-0 and pMsg is NULL then
491 ** json_err_str() is used to get the error string. The caller may
492 ** provide his own or may use an empty string to suppress the
493
--- src/json.c
+++ src/json.c
@@ -13,16 +13,23 @@
13 ** [email protected]
14 ** http://www.hwaci.com/drh/
15 **
16 *******************************************************************************
17 **
18 ** Code for the JSON API.
19 **
20 ** For notes regarding the public JSON interface, please see:
21 **
22 ** https://docs.google.com/document/d/1fXViveNhDbiXgCuE7QDXQOKeFzf2qNUkBEgiUvoqFN4/edit
23 **
24 **
25 ** Notable FIXMEs:
26 **
27 ** - The overlap between cson_cgi and fossil needs to be gotten rid
28 ** of because cson_cgi cannot get all the environment info it needs
29 ** when fossil is running in server mode. The goal is to remove all
30 ** of the cson_cgi bits.
31 */
32 #include "config.h"
33 #include "VERSION.h"
34 #include "json.h"
35 #include <assert.h>
@@ -344,10 +351,16 @@
351 ** position of the "json" part of the path. Returns NULL if ndx is out
352 ** of bounds or there is no "json" path element.
353 **
354 ** In CLI mode the "path" is the list of arguments (skipping argv[0]).
355 ** In server/CGI modes the path is taken from PATH_INFO.
356 **
357 **
358 ** Reminder to self: this breaks in CLI mode when called with an
359 ** abbreviated name because we rely on the full name "json" here. The
360 ** g object probably has the short form which we can use for our
361 ** purposes, but i haven't yet looked for it.
362 */
363 static char const * json_command_arg(unsigned char ndx){
364 cson_array * ar = cson_value_get_array(
365 cson_cgi_getenv(&g.json.cgiCx,
366 "a",
@@ -475,18 +488,19 @@
488
489 }
490 #endif
491
492 /*
493 ** Creates a new Fossil/JSON response envelope skeleton. It is owned
494 ** by the caller, who must eventually free it using cson_value_free(),
495 ** or add it to a cson container to transfer ownership. Returns NULL
496 ** on error.
497 **
498 ** If payload is not NULL and resultCode is 0 then it is set as the
499 ** "payload" property of the returned object. If resultCode is non-0
500 ** then this function will destroy payload if it is not NULL. i.e.
501 ** onwership of payload is transfered to this function.
502 **
503 ** pMsg is an optional message string (resultText) property of the
504 ** response. If resultCode is non-0 and pMsg is NULL then
505 ** json_err_str() is used to get the error string. The caller may
506 ** provide his own or may use an empty string to suppress the
507

Keyboard Shortcuts

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