Fossil SCM

Add missing 'void' to no-arg function decls and impls throughout the JSON API. (In my defense: the distinction between f(void) and f() was unknown to me at the time that code was written.)

stephan 2023-01-19 01:01 json-settings-command
Commit 632dfd26dda2fa1cf8ac90415c559174df81fef81ba29f3ba723551f0e9af659
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -246,11 +246,11 @@
246246
** If the "format" (CLI: -f) flag is set function returns the same as
247247
** json_wiki_get_content_format_flag(), else it returns true (non-0)
248248
** if either the includeContent (HTTP) or -content|-c boolean flags
249249
** (CLI) are set.
250250
*/
251
-static int json_artifact_get_content_format_flag(){
251
+static int json_artifact_get_content_format_flag(void){
252252
enum { MagicValue = -9 };
253253
int contentFormat = json_wiki_get_content_format_flag(MagicValue);
254254
if(MagicValue == contentFormat){
255255
contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0;
256256
}
@@ -398,11 +398,11 @@
398398
399399
/*
400400
** Impl of /json/artifact. This basically just determines the type of
401401
** an artifact and forwards the real work to another function.
402402
*/
403
-cson_value * json_page_artifact(){
403
+cson_value * json_page_artifact(void){
404404
cson_object * pay = NULL;
405405
char const * zName = NULL;
406406
char const * zType = NULL;
407407
char const * zUuid = NULL;
408408
cson_value * entry = NULL;
409409
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -246,11 +246,11 @@
246 ** If the "format" (CLI: -f) flag is set function returns the same as
247 ** json_wiki_get_content_format_flag(), else it returns true (non-0)
248 ** if either the includeContent (HTTP) or -content|-c boolean flags
249 ** (CLI) are set.
250 */
251 static int json_artifact_get_content_format_flag(){
252 enum { MagicValue = -9 };
253 int contentFormat = json_wiki_get_content_format_flag(MagicValue);
254 if(MagicValue == contentFormat){
255 contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0;
256 }
@@ -398,11 +398,11 @@
398
399 /*
400 ** Impl of /json/artifact. This basically just determines the type of
401 ** an artifact and forwards the real work to another function.
402 */
403 cson_value * json_page_artifact(){
404 cson_object * pay = NULL;
405 char const * zName = NULL;
406 char const * zType = NULL;
407 char const * zUuid = NULL;
408 cson_value * entry = NULL;
409
--- src/json_artifact.c
+++ src/json_artifact.c
@@ -246,11 +246,11 @@
246 ** If the "format" (CLI: -f) flag is set function returns the same as
247 ** json_wiki_get_content_format_flag(), else it returns true (non-0)
248 ** if either the includeContent (HTTP) or -content|-c boolean flags
249 ** (CLI) are set.
250 */
251 static int json_artifact_get_content_format_flag(void){
252 enum { MagicValue = -9 };
253 int contentFormat = json_wiki_get_content_format_flag(MagicValue);
254 if(MagicValue == contentFormat){
255 contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0;
256 }
@@ -398,11 +398,11 @@
398
399 /*
400 ** Impl of /json/artifact. This basically just determines the type of
401 ** an artifact and forwards the real work to another function.
402 */
403 cson_value * json_page_artifact(void){
404 cson_object * pay = NULL;
405 char const * zName = NULL;
406 char const * zType = NULL;
407 char const * zUuid = NULL;
408 cson_value * entry = NULL;
409
--- src/json_branch.c
+++ src/json_branch.c
@@ -22,12 +22,12 @@
2222
#if INTERFACE
2323
#include "json_detail.h"
2424
#endif
2525
2626
27
-static cson_value * json_branch_list();
28
-static cson_value * json_branch_create();
27
+static cson_value * json_branch_list(void);
28
+static cson_value * json_branch_create(void);
2929
/*
3030
** Mapping of /json/branch/XXX commands/paths to callbacks.
3131
*/
3232
static const JsonPageDef JsonPageDefs_Branch[] = {
3333
{"create", json_branch_create, 0},
@@ -40,11 +40,11 @@
4040
/*
4141
** Implements the /json/branch family of pages/commands. Far from
4242
** complete.
4343
**
4444
*/
45
-cson_value * json_page_branch(){
45
+cson_value * json_page_branch(void){
4646
return json_page_dispatch_helper(&JsonPageDefs_Branch[0]);
4747
}
4848
4949
/*
5050
** Impl for /json/branch/list
@@ -60,11 +60,11 @@
6060
** HTTP mode options:
6161
**
6262
** "range" GET/POST.payload parameter. FIXME: currently we also use
6363
** POST, but really want to restrict this to POST.payload.
6464
*/
65
-static cson_value * json_branch_list(){
65
+static cson_value * json_branch_list(void){
6666
cson_value * payV;
6767
cson_object * pay;
6868
cson_value * listV;
6969
cson_array * list;
7070
char const * range = NULL;
@@ -313,11 +313,11 @@
313313
314314
315315
/*
316316
** Impl of /json/branch/create.
317317
*/
318
-static cson_value * json_branch_create(){
318
+static cson_value * json_branch_create(void){
319319
cson_value * payV = NULL;
320320
cson_object * pay = NULL;
321321
int rc = 0;
322322
BranchCreateOptions opt;
323323
char * zUuid = NULL;
324324
--- src/json_branch.c
+++ src/json_branch.c
@@ -22,12 +22,12 @@
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26
27 static cson_value * json_branch_list();
28 static cson_value * json_branch_create();
29 /*
30 ** Mapping of /json/branch/XXX commands/paths to callbacks.
31 */
32 static const JsonPageDef JsonPageDefs_Branch[] = {
33 {"create", json_branch_create, 0},
@@ -40,11 +40,11 @@
40 /*
41 ** Implements the /json/branch family of pages/commands. Far from
42 ** complete.
43 **
44 */
45 cson_value * json_page_branch(){
46 return json_page_dispatch_helper(&JsonPageDefs_Branch[0]);
47 }
48
49 /*
50 ** Impl for /json/branch/list
@@ -60,11 +60,11 @@
60 ** HTTP mode options:
61 **
62 ** "range" GET/POST.payload parameter. FIXME: currently we also use
63 ** POST, but really want to restrict this to POST.payload.
64 */
65 static cson_value * json_branch_list(){
66 cson_value * payV;
67 cson_object * pay;
68 cson_value * listV;
69 cson_array * list;
70 char const * range = NULL;
@@ -313,11 +313,11 @@
313
314
315 /*
316 ** Impl of /json/branch/create.
317 */
318 static cson_value * json_branch_create(){
319 cson_value * payV = NULL;
320 cson_object * pay = NULL;
321 int rc = 0;
322 BranchCreateOptions opt;
323 char * zUuid = NULL;
324
--- src/json_branch.c
+++ src/json_branch.c
@@ -22,12 +22,12 @@
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26
27 static cson_value * json_branch_list(void);
28 static cson_value * json_branch_create(void);
29 /*
30 ** Mapping of /json/branch/XXX commands/paths to callbacks.
31 */
32 static const JsonPageDef JsonPageDefs_Branch[] = {
33 {"create", json_branch_create, 0},
@@ -40,11 +40,11 @@
40 /*
41 ** Implements the /json/branch family of pages/commands. Far from
42 ** complete.
43 **
44 */
45 cson_value * json_page_branch(void){
46 return json_page_dispatch_helper(&JsonPageDefs_Branch[0]);
47 }
48
49 /*
50 ** Impl for /json/branch/list
@@ -60,11 +60,11 @@
60 ** HTTP mode options:
61 **
62 ** "range" GET/POST.payload parameter. FIXME: currently we also use
63 ** POST, but really want to restrict this to POST.payload.
64 */
65 static cson_value * json_branch_list(void){
66 cson_value * payV;
67 cson_object * pay;
68 cson_value * listV;
69 cson_array * list;
70 char const * range = NULL;
@@ -313,11 +313,11 @@
313
314
315 /*
316 ** Impl of /json/branch/create.
317 */
318 static cson_value * json_branch_create(void){
319 cson_value * payV = NULL;
320 cson_object * pay = NULL;
321 int rc = 0;
322 BranchCreateOptions opt;
323 char * zUuid = NULL;
324
--- src/json_detail.h
+++ src/json_detail.h
@@ -149,11 +149,11 @@
149149
** almost certainly will corrupt any HTTP response headers. Output
150150
** sent to stderr ends up in my apache log, so that might be useful
151151
** for debugging in some cases, but no such code should be left
152152
** enabled for non-debugging builds.
153153
*/
154
-typedef cson_value * (*fossil_json_f)();
154
+typedef cson_value * (*fossil_json_f)(void);
155155
156156
/*
157157
** Holds name-to-function mappings for JSON page/command dispatching.
158158
**
159159
** Internally we model page dispatching lists as arrays of these
@@ -260,14 +260,14 @@
260260
**
261261
** Whether or not we need to take args from CLI or POST data makes a
262262
** difference in argument/parameter handling in many JSON routines,
263263
** and thus this distinction.
264264
*/
265
-int fossil_has_json();
265
+int fossil_has_json(void);
266266
267267
enum json_get_changed_files_flags {
268268
json_get_changed_files_ELIDE_PARENT = 1 << 0
269269
};
270270
271271
#endif /* !defined(_RC_COMPILE_) */
272272
#endif/*FOSSIL_JSON_DETAIL_H_INCLUDED*/
273273
#endif /* FOSSIL_ENABLE_JSON */
274274
--- src/json_detail.h
+++ src/json_detail.h
@@ -149,11 +149,11 @@
149 ** almost certainly will corrupt any HTTP response headers. Output
150 ** sent to stderr ends up in my apache log, so that might be useful
151 ** for debugging in some cases, but no such code should be left
152 ** enabled for non-debugging builds.
153 */
154 typedef cson_value * (*fossil_json_f)();
155
156 /*
157 ** Holds name-to-function mappings for JSON page/command dispatching.
158 **
159 ** Internally we model page dispatching lists as arrays of these
@@ -260,14 +260,14 @@
260 **
261 ** Whether or not we need to take args from CLI or POST data makes a
262 ** difference in argument/parameter handling in many JSON routines,
263 ** and thus this distinction.
264 */
265 int fossil_has_json();
266
267 enum json_get_changed_files_flags {
268 json_get_changed_files_ELIDE_PARENT = 1 << 0
269 };
270
271 #endif /* !defined(_RC_COMPILE_) */
272 #endif/*FOSSIL_JSON_DETAIL_H_INCLUDED*/
273 #endif /* FOSSIL_ENABLE_JSON */
274
--- src/json_detail.h
+++ src/json_detail.h
@@ -149,11 +149,11 @@
149 ** almost certainly will corrupt any HTTP response headers. Output
150 ** sent to stderr ends up in my apache log, so that might be useful
151 ** for debugging in some cases, but no such code should be left
152 ** enabled for non-debugging builds.
153 */
154 typedef cson_value * (*fossil_json_f)(void);
155
156 /*
157 ** Holds name-to-function mappings for JSON page/command dispatching.
158 **
159 ** Internally we model page dispatching lists as arrays of these
@@ -260,14 +260,14 @@
260 **
261 ** Whether or not we need to take args from CLI or POST data makes a
262 ** difference in argument/parameter handling in many JSON routines,
263 ** and thus this distinction.
264 */
265 int fossil_has_json(void);
266
267 enum json_get_changed_files_flags {
268 json_get_changed_files_ELIDE_PARENT = 1 << 0
269 };
270
271 #endif /* !defined(_RC_COMPILE_) */
272 #endif/*FOSSIL_JSON_DETAIL_H_INCLUDED*/
273 #endif /* FOSSIL_ENABLE_JSON */
274
+1 -1
--- src/json_diff.c
+++ src/json_diff.c
@@ -83,11 +83,11 @@
8383
**
8484
** Can come from GET, POST.payload, CLI -v1/-v2 or as positional
8585
** parameters following the command name (in HTTP and CLI modes).
8686
**
8787
*/
88
-cson_value * json_page_diff(){
88
+cson_value * json_page_diff(void){
8989
cson_object * pay = NULL;
9090
cson_value * v = NULL;
9191
char const * zFrom;
9292
char const * zTo;
9393
int nContext = 0;
9494
--- src/json_diff.c
+++ src/json_diff.c
@@ -83,11 +83,11 @@
83 **
84 ** Can come from GET, POST.payload, CLI -v1/-v2 or as positional
85 ** parameters following the command name (in HTTP and CLI modes).
86 **
87 */
88 cson_value * json_page_diff(){
89 cson_object * pay = NULL;
90 cson_value * v = NULL;
91 char const * zFrom;
92 char const * zTo;
93 int nContext = 0;
94
--- src/json_diff.c
+++ src/json_diff.c
@@ -83,11 +83,11 @@
83 **
84 ** Can come from GET, POST.payload, CLI -v1/-v2 or as positional
85 ** parameters following the command name (in HTTP and CLI modes).
86 **
87 */
88 cson_value * json_page_diff(void){
89 cson_object * pay = NULL;
90 cson_value * v = NULL;
91 char const * zFrom;
92 char const * zTo;
93 int nContext = 0;
94
+4 -4
--- src/json_dir.c
+++ src/json_dir.c
@@ -21,11 +21,11 @@
2121
2222
#if INTERFACE
2323
#include "json_detail.h"
2424
#endif
2525
26
-static cson_value * json_page_dir_list();
26
+static cson_value * json_page_dir_list(void);
2727
/*
2828
** Mapping of /json/wiki/XXX commands/paths to callbacks.
2929
*/
3030
#if 0 /* TODO: Not used? */
3131
static const JsonPageDef JsonPageDefs_Dir[] = {
@@ -33,11 +33,11 @@
3333
{NULL,NULL,0}
3434
};
3535
#endif
3636
3737
#if 0 /* TODO: Not used? */
38
-static char const * json_dir_path_extra(){
38
+static char const * json_dir_path_extra(void){
3939
static char const * zP = NULL;
4040
if( !zP ){
4141
zP = g.zExtra;
4242
while(zP && *zP && ('/'==*zP)){
4343
++zP;
@@ -49,11 +49,11 @@
4949
5050
/*
5151
** Impl of /json/dir. 98% of it was taken directly
5252
** from browse.c::page_dir()
5353
*/
54
-static cson_value * json_page_dir_list(){
54
+static cson_value * json_page_dir_list(void){
5555
cson_object * zPayload = NULL; /* return value */
5656
cson_array * zEntries = NULL; /* accumulated list of entries. */
5757
cson_object * zEntry = NULL; /* a single dir/file entry. */
5858
cson_array * keyStore = NULL; /* garbage collector for shared strings. */
5959
cson_string * zKeyName = NULL;
@@ -281,14 +281,14 @@
281281
282282
/*
283283
** Implements the /json/dir family of pages/commands.
284284
**
285285
*/
286
-cson_value * json_page_dir(){
286
+cson_value * json_page_dir(void){
287287
#if 1
288288
return json_page_dir_list();
289289
#else
290290
return json_page_dispatch_helper(&JsonPageDefs_Dir[0]);
291291
#endif
292292
}
293293
294294
#endif /* FOSSIL_ENABLE_JSON */
295295
--- src/json_dir.c
+++ src/json_dir.c
@@ -21,11 +21,11 @@
21
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26 static cson_value * json_page_dir_list();
27 /*
28 ** Mapping of /json/wiki/XXX commands/paths to callbacks.
29 */
30 #if 0 /* TODO: Not used? */
31 static const JsonPageDef JsonPageDefs_Dir[] = {
@@ -33,11 +33,11 @@
33 {NULL,NULL,0}
34 };
35 #endif
36
37 #if 0 /* TODO: Not used? */
38 static char const * json_dir_path_extra(){
39 static char const * zP = NULL;
40 if( !zP ){
41 zP = g.zExtra;
42 while(zP && *zP && ('/'==*zP)){
43 ++zP;
@@ -49,11 +49,11 @@
49
50 /*
51 ** Impl of /json/dir. 98% of it was taken directly
52 ** from browse.c::page_dir()
53 */
54 static cson_value * json_page_dir_list(){
55 cson_object * zPayload = NULL; /* return value */
56 cson_array * zEntries = NULL; /* accumulated list of entries. */
57 cson_object * zEntry = NULL; /* a single dir/file entry. */
58 cson_array * keyStore = NULL; /* garbage collector for shared strings. */
59 cson_string * zKeyName = NULL;
@@ -281,14 +281,14 @@
281
282 /*
283 ** Implements the /json/dir family of pages/commands.
284 **
285 */
286 cson_value * json_page_dir(){
287 #if 1
288 return json_page_dir_list();
289 #else
290 return json_page_dispatch_helper(&JsonPageDefs_Dir[0]);
291 #endif
292 }
293
294 #endif /* FOSSIL_ENABLE_JSON */
295
--- src/json_dir.c
+++ src/json_dir.c
@@ -21,11 +21,11 @@
21
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26 static cson_value * json_page_dir_list(void);
27 /*
28 ** Mapping of /json/wiki/XXX commands/paths to callbacks.
29 */
30 #if 0 /* TODO: Not used? */
31 static const JsonPageDef JsonPageDefs_Dir[] = {
@@ -33,11 +33,11 @@
33 {NULL,NULL,0}
34 };
35 #endif
36
37 #if 0 /* TODO: Not used? */
38 static char const * json_dir_path_extra(void){
39 static char const * zP = NULL;
40 if( !zP ){
41 zP = g.zExtra;
42 while(zP && *zP && ('/'==*zP)){
43 ++zP;
@@ -49,11 +49,11 @@
49
50 /*
51 ** Impl of /json/dir. 98% of it was taken directly
52 ** from browse.c::page_dir()
53 */
54 static cson_value * json_page_dir_list(void){
55 cson_object * zPayload = NULL; /* return value */
56 cson_array * zEntries = NULL; /* accumulated list of entries. */
57 cson_object * zEntry = NULL; /* a single dir/file entry. */
58 cson_array * keyStore = NULL; /* garbage collector for shared strings. */
59 cson_string * zKeyName = NULL;
@@ -281,14 +281,14 @@
281
282 /*
283 ** Implements the /json/dir family of pages/commands.
284 **
285 */
286 cson_value * json_page_dir(void){
287 #if 1
288 return json_page_dir_list();
289 #else
290 return json_page_dispatch_helper(&JsonPageDefs_Dir[0]);
291 #endif
292 }
293
294 #endif /* FOSSIL_ENABLE_JSON */
295
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -25,11 +25,11 @@
2525
2626
/*
2727
** Implements the /json/finfo page/command.
2828
**
2929
*/
30
-cson_value * json_page_finfo(){
30
+cson_value * json_page_finfo(void){
3131
cson_object * pay = NULL;
3232
cson_array * checkins = NULL;
3333
char const * zFilename = NULL;
3434
Blob sql = empty_blob;
3535
Stmt q = empty_Stmt;
3636
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -25,11 +25,11 @@
25
26 /*
27 ** Implements the /json/finfo page/command.
28 **
29 */
30 cson_value * json_page_finfo(){
31 cson_object * pay = NULL;
32 cson_array * checkins = NULL;
33 char const * zFilename = NULL;
34 Blob sql = empty_blob;
35 Stmt q = empty_Stmt;
36
--- src/json_finfo.c
+++ src/json_finfo.c
@@ -25,11 +25,11 @@
25
26 /*
27 ** Implements the /json/finfo page/command.
28 **
29 */
30 cson_value * json_page_finfo(void){
31 cson_object * pay = NULL;
32 cson_array * checkins = NULL;
33 char const * zFilename = NULL;
34 Blob sql = empty_blob;
35 Stmt q = empty_Stmt;
36
--- src/json_login.c
+++ src/json_login.c
@@ -26,11 +26,11 @@
2626
2727
/*
2828
** Implementation of the /json/login page.
2929
**
3030
*/
31
-cson_value * json_page_login(){
31
+cson_value * json_page_login(void){
3232
char preciseErrors = /* if true, "complete" JSON error codes are used,
3333
else they are "dumbed down" to a generic login
3434
error code.
3535
*/
3636
#if 1
@@ -181,11 +181,11 @@
181181
182182
/*
183183
** Impl of /json/logout.
184184
**
185185
*/
186
-cson_value * json_page_logout(){
186
+cson_value * json_page_logout(void){
187187
cson_value const *token = g.json.authToken;
188188
/* Remember that json_bootstrap_late() replaces the login cookie
189189
with the JSON auth token if the request contains it. If the
190190
request is missing the auth token then this will fetch fossil's
191191
original cookie. Either way, it's what we want :).
@@ -207,11 +207,11 @@
207207
}
208208
209209
/*
210210
** Implementation of the /json/anonymousPassword page.
211211
*/
212
-cson_value * json_page_anon_password(){
212
+cson_value * json_page_anon_password(void){
213213
cson_value * v = cson_value_new_object();
214214
cson_object * o = cson_value_get_object(v);
215215
unsigned const int seed = captcha_seed();
216216
char const * zCaptcha = captcha_decode(seed);
217217
cson_object_set(o, "seed",
@@ -226,11 +226,11 @@
226226
227227
228228
/*
229229
** Implements the /json/whoami page/command.
230230
*/
231
-cson_value * json_page_whoami(){
231
+cson_value * json_page_whoami(void){
232232
cson_value * payload = NULL;
233233
cson_object * obj = NULL;
234234
Stmt q;
235235
if(!g.json.authToken && g.userUid==0){
236236
/* assume we just logged out. */
237237
--- src/json_login.c
+++ src/json_login.c
@@ -26,11 +26,11 @@
26
27 /*
28 ** Implementation of the /json/login page.
29 **
30 */
31 cson_value * json_page_login(){
32 char preciseErrors = /* if true, "complete" JSON error codes are used,
33 else they are "dumbed down" to a generic login
34 error code.
35 */
36 #if 1
@@ -181,11 +181,11 @@
181
182 /*
183 ** Impl of /json/logout.
184 **
185 */
186 cson_value * json_page_logout(){
187 cson_value const *token = g.json.authToken;
188 /* Remember that json_bootstrap_late() replaces the login cookie
189 with the JSON auth token if the request contains it. If the
190 request is missing the auth token then this will fetch fossil's
191 original cookie. Either way, it's what we want :).
@@ -207,11 +207,11 @@
207 }
208
209 /*
210 ** Implementation of the /json/anonymousPassword page.
211 */
212 cson_value * json_page_anon_password(){
213 cson_value * v = cson_value_new_object();
214 cson_object * o = cson_value_get_object(v);
215 unsigned const int seed = captcha_seed();
216 char const * zCaptcha = captcha_decode(seed);
217 cson_object_set(o, "seed",
@@ -226,11 +226,11 @@
226
227
228 /*
229 ** Implements the /json/whoami page/command.
230 */
231 cson_value * json_page_whoami(){
232 cson_value * payload = NULL;
233 cson_object * obj = NULL;
234 Stmt q;
235 if(!g.json.authToken && g.userUid==0){
236 /* assume we just logged out. */
237
--- src/json_login.c
+++ src/json_login.c
@@ -26,11 +26,11 @@
26
27 /*
28 ** Implementation of the /json/login page.
29 **
30 */
31 cson_value * json_page_login(void){
32 char preciseErrors = /* if true, "complete" JSON error codes are used,
33 else they are "dumbed down" to a generic login
34 error code.
35 */
36 #if 1
@@ -181,11 +181,11 @@
181
182 /*
183 ** Impl of /json/logout.
184 **
185 */
186 cson_value * json_page_logout(void){
187 cson_value const *token = g.json.authToken;
188 /* Remember that json_bootstrap_late() replaces the login cookie
189 with the JSON auth token if the request contains it. If the
190 request is missing the auth token then this will fetch fossil's
191 original cookie. Either way, it's what we want :).
@@ -207,11 +207,11 @@
207 }
208
209 /*
210 ** Implementation of the /json/anonymousPassword page.
211 */
212 cson_value * json_page_anon_password(void){
213 cson_value * v = cson_value_new_object();
214 cson_object * o = cson_value_get_object(v);
215 unsigned const int seed = captcha_seed();
216 char const * zCaptcha = captcha_decode(seed);
217 cson_object_set(o, "seed",
@@ -226,11 +226,11 @@
226
227
228 /*
229 ** Implements the /json/whoami page/command.
230 */
231 cson_value * json_page_whoami(void){
232 cson_value * payload = NULL;
233 cson_object * obj = NULL;
234 Stmt q;
235 if(!g.json.authToken && g.userUid==0){
236 /* assume we just logged out. */
237
--- src/json_query.c
+++ src/json_query.c
@@ -38,11 +38,11 @@
3838
** (default) creates each row as an Object.
3939
**
4040
** TODO: in CLI mode (only) use -S FILENAME to read the sql
4141
** from a file.
4242
*/
43
-cson_value * json_page_query(){
43
+cson_value * json_page_query(void){
4444
char const * zSql = NULL;
4545
cson_value * payV;
4646
char const * zFmt;
4747
Stmt q = empty_Stmt;
4848
int check;
4949
--- src/json_query.c
+++ src/json_query.c
@@ -38,11 +38,11 @@
38 ** (default) creates each row as an Object.
39 **
40 ** TODO: in CLI mode (only) use -S FILENAME to read the sql
41 ** from a file.
42 */
43 cson_value * json_page_query(){
44 char const * zSql = NULL;
45 cson_value * payV;
46 char const * zFmt;
47 Stmt q = empty_Stmt;
48 int check;
49
--- src/json_query.c
+++ src/json_query.c
@@ -38,11 +38,11 @@
38 ** (default) creates each row as an Object.
39 **
40 ** TODO: in CLI mode (only) use -S FILENAME to read the sql
41 ** from a file.
42 */
43 cson_value * json_page_query(void){
44 char const * zSql = NULL;
45 cson_value * payV;
46 char const * zFmt;
47 Stmt q = empty_Stmt;
48 int check;
49
+11 -11
--- src/json_report.c
+++ src/json_report.c
@@ -22,15 +22,15 @@
2222
#if INTERFACE
2323
#include "json_detail.h"
2424
#endif
2525
2626
27
-static cson_value * json_report_create();
28
-static cson_value * json_report_get();
29
-static cson_value * json_report_list();
30
-static cson_value * json_report_run();
31
-static cson_value * json_report_save();
27
+static cson_value * json_report_create(void);
28
+static cson_value * json_report_get(void);
29
+static cson_value * json_report_list(void);
30
+static cson_value * json_report_run(void);
31
+static cson_value * json_report_save(void);
3232
3333
/*
3434
** Mapping of /json/report/XXX commands/paths to callbacks.
3535
*/
3636
static const JsonPageDef JsonPageDefs_Report[] = {
@@ -45,11 +45,11 @@
4545
/*
4646
** Implementation of the /json/report page.
4747
**
4848
**
4949
*/
50
-cson_value * json_page_report(){
50
+cson_value * json_page_report(void){
5151
if(!g.perm.RdTkt && !g.perm.NewTkt ){
5252
json_set_err(FSL_JSON_E_DENIED,
5353
"Requires 'r' or 'n' permissions.");
5454
return NULL;
5555
}
@@ -77,16 +77,16 @@
7777
}
7878
}
7979
return nReport;
8080
}
8181
82
-static cson_value * json_report_create(){
82
+static cson_value * json_report_create(void){
8383
json_set_err(FSL_JSON_E_NYI, NULL);
8484
return NULL;
8585
}
8686
87
-static cson_value * json_report_get(){
87
+static cson_value * json_report_get(void){
8888
int nReport;
8989
Stmt q = empty_Stmt;
9090
cson_value * pay = NULL;
9191
9292
if(!g.perm.TktFmt){
@@ -122,11 +122,11 @@
122122
}
123123
124124
/*
125125
** Impl of /json/report/list.
126126
*/
127
-static cson_value * json_report_list(){
127
+static cson_value * json_report_list(void){
128128
Blob sql = empty_blob;
129129
cson_value * pay = NULL;
130130
if(!g.perm.RdTkt){
131131
json_set_err(FSL_JSON_E_DENIED,
132132
"Requires 'r' privileges.");
@@ -158,11 +158,11 @@
158158
** limit=int (CLI: -limit # or -n #) -n is for compat. with other commands.
159159
**
160160
** format=a|o Specifies result format: a=each row is an arry, o=each
161161
** row is an object. Default=o.
162162
*/
163
-static cson_value * json_report_run(){
163
+static cson_value * json_report_run(void){
164164
int nReport;
165165
Stmt q = empty_Stmt;
166166
cson_object * pay = NULL;
167167
cson_array * tktList = NULL;
168168
char const * zFmt;
@@ -255,9 +255,9 @@
255255
256256
return pay ? cson_object_value(pay) : NULL;
257257
258258
}
259259
260
-static cson_value * json_report_save(){
260
+static cson_value * json_report_save(void){
261261
return NULL;
262262
}
263263
#endif /* FOSSIL_ENABLE_JSON */
264264
--- src/json_report.c
+++ src/json_report.c
@@ -22,15 +22,15 @@
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26
27 static cson_value * json_report_create();
28 static cson_value * json_report_get();
29 static cson_value * json_report_list();
30 static cson_value * json_report_run();
31 static cson_value * json_report_save();
32
33 /*
34 ** Mapping of /json/report/XXX commands/paths to callbacks.
35 */
36 static const JsonPageDef JsonPageDefs_Report[] = {
@@ -45,11 +45,11 @@
45 /*
46 ** Implementation of the /json/report page.
47 **
48 **
49 */
50 cson_value * json_page_report(){
51 if(!g.perm.RdTkt && !g.perm.NewTkt ){
52 json_set_err(FSL_JSON_E_DENIED,
53 "Requires 'r' or 'n' permissions.");
54 return NULL;
55 }
@@ -77,16 +77,16 @@
77 }
78 }
79 return nReport;
80 }
81
82 static cson_value * json_report_create(){
83 json_set_err(FSL_JSON_E_NYI, NULL);
84 return NULL;
85 }
86
87 static cson_value * json_report_get(){
88 int nReport;
89 Stmt q = empty_Stmt;
90 cson_value * pay = NULL;
91
92 if(!g.perm.TktFmt){
@@ -122,11 +122,11 @@
122 }
123
124 /*
125 ** Impl of /json/report/list.
126 */
127 static cson_value * json_report_list(){
128 Blob sql = empty_blob;
129 cson_value * pay = NULL;
130 if(!g.perm.RdTkt){
131 json_set_err(FSL_JSON_E_DENIED,
132 "Requires 'r' privileges.");
@@ -158,11 +158,11 @@
158 ** limit=int (CLI: -limit # or -n #) -n is for compat. with other commands.
159 **
160 ** format=a|o Specifies result format: a=each row is an arry, o=each
161 ** row is an object. Default=o.
162 */
163 static cson_value * json_report_run(){
164 int nReport;
165 Stmt q = empty_Stmt;
166 cson_object * pay = NULL;
167 cson_array * tktList = NULL;
168 char const * zFmt;
@@ -255,9 +255,9 @@
255
256 return pay ? cson_object_value(pay) : NULL;
257
258 }
259
260 static cson_value * json_report_save(){
261 return NULL;
262 }
263 #endif /* FOSSIL_ENABLE_JSON */
264
--- src/json_report.c
+++ src/json_report.c
@@ -22,15 +22,15 @@
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26
27 static cson_value * json_report_create(void);
28 static cson_value * json_report_get(void);
29 static cson_value * json_report_list(void);
30 static cson_value * json_report_run(void);
31 static cson_value * json_report_save(void);
32
33 /*
34 ** Mapping of /json/report/XXX commands/paths to callbacks.
35 */
36 static const JsonPageDef JsonPageDefs_Report[] = {
@@ -45,11 +45,11 @@
45 /*
46 ** Implementation of the /json/report page.
47 **
48 **
49 */
50 cson_value * json_page_report(void){
51 if(!g.perm.RdTkt && !g.perm.NewTkt ){
52 json_set_err(FSL_JSON_E_DENIED,
53 "Requires 'r' or 'n' permissions.");
54 return NULL;
55 }
@@ -77,16 +77,16 @@
77 }
78 }
79 return nReport;
80 }
81
82 static cson_value * json_report_create(void){
83 json_set_err(FSL_JSON_E_NYI, NULL);
84 return NULL;
85 }
86
87 static cson_value * json_report_get(void){
88 int nReport;
89 Stmt q = empty_Stmt;
90 cson_value * pay = NULL;
91
92 if(!g.perm.TktFmt){
@@ -122,11 +122,11 @@
122 }
123
124 /*
125 ** Impl of /json/report/list.
126 */
127 static cson_value * json_report_list(void){
128 Blob sql = empty_blob;
129 cson_value * pay = NULL;
130 if(!g.perm.RdTkt){
131 json_set_err(FSL_JSON_E_DENIED,
132 "Requires 'r' privileges.");
@@ -158,11 +158,11 @@
158 ** limit=int (CLI: -limit # or -n #) -n is for compat. with other commands.
159 **
160 ** format=a|o Specifies result format: a=each row is an arry, o=each
161 ** row is an object. Default=o.
162 */
163 static cson_value * json_report_run(void){
164 int nReport;
165 Stmt q = empty_Stmt;
166 cson_object * pay = NULL;
167 cson_array * tktList = NULL;
168 char const * zFmt;
@@ -255,9 +255,9 @@
255
256 return pay ? cson_object_value(pay) : NULL;
257
258 }
259
260 static cson_value * json_report_save(void){
261 return NULL;
262 }
263 #endif /* FOSSIL_ENABLE_JSON */
264
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -22,13 +22,13 @@
2222
2323
#if INTERFACE
2424
#include "json_detail.h"
2525
#endif
2626
27
-static cson_value * json_timeline_branch();
28
-static cson_value * json_timeline_ci();
29
-static cson_value * json_timeline_ticket();
27
+static cson_value * json_timeline_branch(void);
28
+static cson_value * json_timeline_ci(void);
29
+static cson_value * json_timeline_ticket(void);
3030
/*
3131
** Mapping of /json/timeline/XXX commands/paths to callbacks.
3232
*/
3333
static const JsonPageDef JsonPageDefs_Timeline[] = {
3434
/* the short forms are only enabled in CLI mode, to avoid
@@ -49,11 +49,11 @@
4949
/*
5050
** Implements the /json/timeline family of pages/commands. Far from
5151
** complete.
5252
**
5353
*/
54
-cson_value * json_page_timeline(){
54
+cson_value * json_page_timeline(void){
5555
#if 0
5656
/* The original timeline code does not require 'h' access,
5757
but it arguably should. For JSON mode i think one could argue
5858
that History permissions are required.
5959
*/
@@ -364,11 +364,11 @@
364364
}
365365
db_finalize(&q);
366366
return rowsV;
367367
}
368368
369
-static cson_value * json_timeline_branch(){
369
+static cson_value * json_timeline_branch(void){
370370
cson_value * pay = NULL;
371371
Blob sql = empty_blob;
372372
Stmt q = empty_Stmt;
373373
int limit = 0;
374374
if(!g.perm.Read){
@@ -445,11 +445,11 @@
445445
** Implementation of /json/timeline/ci.
446446
**
447447
** Still a few TODOs (like figuring out how to structure
448448
** inheritance info).
449449
*/
450
-static cson_value * json_timeline_ci(){
450
+static cson_value * json_timeline_ci(void){
451451
cson_value * payV = NULL;
452452
cson_object * pay = NULL;
453453
cson_value * tmp = NULL;
454454
cson_value * listV = NULL;
455455
cson_array * list = NULL;
@@ -526,11 +526,11 @@
526526
527527
/*
528528
** Implementation of /json/timeline/event.
529529
**
530530
*/
531
-cson_value * json_timeline_event(){
531
+cson_value * json_timeline_event(void){
532532
/* This code is 95% the same as json_timeline_ci(), by the way. */
533533
cson_value * payV = NULL;
534534
cson_object * pay = NULL;
535535
cson_array * list = NULL;
536536
int check = 0;
@@ -582,11 +582,11 @@
582582
583583
/*
584584
** Implementation of /json/timeline/wiki.
585585
**
586586
*/
587
-cson_value * json_timeline_wiki(){
587
+cson_value * json_timeline_wiki(void){
588588
/* This code is 95% the same as json_timeline_ci(), by the way. */
589589
cson_value * payV = NULL;
590590
cson_object * pay = NULL;
591591
cson_array * list = NULL;
592592
int check = 0;
@@ -643,11 +643,11 @@
643643
644644
/*
645645
** Implementation of /json/timeline/ticket.
646646
**
647647
*/
648
-static cson_value * json_timeline_ticket(){
648
+static cson_value * json_timeline_ticket(void){
649649
/* This code is 95% the same as json_timeline_ci(), by the way. */
650650
cson_value * payV = NULL;
651651
cson_object * pay = NULL;
652652
cson_value * tmp = NULL;
653653
cson_value * listV = NULL;
654654
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -22,13 +22,13 @@
22
23 #if INTERFACE
24 #include "json_detail.h"
25 #endif
26
27 static cson_value * json_timeline_branch();
28 static cson_value * json_timeline_ci();
29 static cson_value * json_timeline_ticket();
30 /*
31 ** Mapping of /json/timeline/XXX commands/paths to callbacks.
32 */
33 static const JsonPageDef JsonPageDefs_Timeline[] = {
34 /* the short forms are only enabled in CLI mode, to avoid
@@ -49,11 +49,11 @@
49 /*
50 ** Implements the /json/timeline family of pages/commands. Far from
51 ** complete.
52 **
53 */
54 cson_value * json_page_timeline(){
55 #if 0
56 /* The original timeline code does not require 'h' access,
57 but it arguably should. For JSON mode i think one could argue
58 that History permissions are required.
59 */
@@ -364,11 +364,11 @@
364 }
365 db_finalize(&q);
366 return rowsV;
367 }
368
369 static cson_value * json_timeline_branch(){
370 cson_value * pay = NULL;
371 Blob sql = empty_blob;
372 Stmt q = empty_Stmt;
373 int limit = 0;
374 if(!g.perm.Read){
@@ -445,11 +445,11 @@
445 ** Implementation of /json/timeline/ci.
446 **
447 ** Still a few TODOs (like figuring out how to structure
448 ** inheritance info).
449 */
450 static cson_value * json_timeline_ci(){
451 cson_value * payV = NULL;
452 cson_object * pay = NULL;
453 cson_value * tmp = NULL;
454 cson_value * listV = NULL;
455 cson_array * list = NULL;
@@ -526,11 +526,11 @@
526
527 /*
528 ** Implementation of /json/timeline/event.
529 **
530 */
531 cson_value * json_timeline_event(){
532 /* This code is 95% the same as json_timeline_ci(), by the way. */
533 cson_value * payV = NULL;
534 cson_object * pay = NULL;
535 cson_array * list = NULL;
536 int check = 0;
@@ -582,11 +582,11 @@
582
583 /*
584 ** Implementation of /json/timeline/wiki.
585 **
586 */
587 cson_value * json_timeline_wiki(){
588 /* This code is 95% the same as json_timeline_ci(), by the way. */
589 cson_value * payV = NULL;
590 cson_object * pay = NULL;
591 cson_array * list = NULL;
592 int check = 0;
@@ -643,11 +643,11 @@
643
644 /*
645 ** Implementation of /json/timeline/ticket.
646 **
647 */
648 static cson_value * json_timeline_ticket(){
649 /* This code is 95% the same as json_timeline_ci(), by the way. */
650 cson_value * payV = NULL;
651 cson_object * pay = NULL;
652 cson_value * tmp = NULL;
653 cson_value * listV = NULL;
654
--- src/json_timeline.c
+++ src/json_timeline.c
@@ -22,13 +22,13 @@
22
23 #if INTERFACE
24 #include "json_detail.h"
25 #endif
26
27 static cson_value * json_timeline_branch(void);
28 static cson_value * json_timeline_ci(void);
29 static cson_value * json_timeline_ticket(void);
30 /*
31 ** Mapping of /json/timeline/XXX commands/paths to callbacks.
32 */
33 static const JsonPageDef JsonPageDefs_Timeline[] = {
34 /* the short forms are only enabled in CLI mode, to avoid
@@ -49,11 +49,11 @@
49 /*
50 ** Implements the /json/timeline family of pages/commands. Far from
51 ** complete.
52 **
53 */
54 cson_value * json_page_timeline(void){
55 #if 0
56 /* The original timeline code does not require 'h' access,
57 but it arguably should. For JSON mode i think one could argue
58 that History permissions are required.
59 */
@@ -364,11 +364,11 @@
364 }
365 db_finalize(&q);
366 return rowsV;
367 }
368
369 static cson_value * json_timeline_branch(void){
370 cson_value * pay = NULL;
371 Blob sql = empty_blob;
372 Stmt q = empty_Stmt;
373 int limit = 0;
374 if(!g.perm.Read){
@@ -445,11 +445,11 @@
445 ** Implementation of /json/timeline/ci.
446 **
447 ** Still a few TODOs (like figuring out how to structure
448 ** inheritance info).
449 */
450 static cson_value * json_timeline_ci(void){
451 cson_value * payV = NULL;
452 cson_object * pay = NULL;
453 cson_value * tmp = NULL;
454 cson_value * listV = NULL;
455 cson_array * list = NULL;
@@ -526,11 +526,11 @@
526
527 /*
528 ** Implementation of /json/timeline/event.
529 **
530 */
531 cson_value * json_timeline_event(void){
532 /* This code is 95% the same as json_timeline_ci(), by the way. */
533 cson_value * payV = NULL;
534 cson_object * pay = NULL;
535 cson_array * list = NULL;
536 int check = 0;
@@ -582,11 +582,11 @@
582
583 /*
584 ** Implementation of /json/timeline/wiki.
585 **
586 */
587 cson_value * json_timeline_wiki(void){
588 /* This code is 95% the same as json_timeline_ci(), by the way. */
589 cson_value * payV = NULL;
590 cson_object * pay = NULL;
591 cson_array * list = NULL;
592 int check = 0;
@@ -643,11 +643,11 @@
643
644 /*
645 ** Implementation of /json/timeline/ticket.
646 **
647 */
648 static cson_value * json_timeline_ticket(void){
649 /* This code is 95% the same as json_timeline_ci(), by the way. */
650 cson_value * payV = NULL;
651 cson_object * pay = NULL;
652 cson_value * tmp = NULL;
653 cson_value * listV = NULL;
654
+7 -7
--- src/json_user.c
+++ src/json_user.c
@@ -21,13 +21,13 @@
2121
2222
#if INTERFACE
2323
#include "json_detail.h"
2424
#endif
2525
26
-static cson_value * json_user_get();
27
-static cson_value * json_user_list();
28
-static cson_value * json_user_save();
26
+static cson_value * json_user_get(void);
27
+static cson_value * json_user_list(void);
28
+static cson_value * json_user_save(void);
2929
3030
/*
3131
** Mapping of /json/user/XXX commands/paths to callbacks.
3232
*/
3333
static const JsonPageDef JsonPageDefs_User[] = {
@@ -41,19 +41,19 @@
4141
4242
/*
4343
** Implements the /json/user family of pages/commands.
4444
**
4545
*/
46
-cson_value * json_page_user(){
46
+cson_value * json_page_user(void){
4747
return json_page_dispatch_helper(&JsonPageDefs_User[0]);
4848
}
4949
5050
5151
/*
5252
** Impl of /json/user/list. Requires admin/setup rights.
5353
*/
54
-static cson_value * json_user_list(){
54
+static cson_value * json_user_list(void){
5555
cson_value * payV = NULL;
5656
Stmt q;
5757
if(!g.perm.Admin && !g.perm.Setup){
5858
json_set_err(FSL_JSON_E_DENIED,
5959
"Requires 'a' or 's' privileges.");
@@ -122,11 +122,11 @@
122122
123123
124124
/*
125125
** Impl of /json/user/get. Requires admin or setup rights.
126126
*/
127
-static cson_value * json_user_get(){
127
+static cson_value * json_user_get(void){
128128
cson_value * payV = NULL;
129129
char const * pUser = NULL;
130130
if(!g.perm.Admin && !g.perm.Setup){
131131
json_set_err(FSL_JSON_E_DENIED,
132132
"Requires 'a' or 's' privileges.");
@@ -393,11 +393,11 @@
393393
394394
395395
/*
396396
** Impl of /json/user/save.
397397
*/
398
-static cson_value * json_user_save(){
398
+static cson_value * json_user_save(void){
399399
/* try to get user info from GET/CLI args and construct
400400
a JSON form of it... */
401401
cson_object * u = cson_new_object();
402402
char const * str = NULL;
403403
int b = -1;
404404
--- src/json_user.c
+++ src/json_user.c
@@ -21,13 +21,13 @@
21
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26 static cson_value * json_user_get();
27 static cson_value * json_user_list();
28 static cson_value * json_user_save();
29
30 /*
31 ** Mapping of /json/user/XXX commands/paths to callbacks.
32 */
33 static const JsonPageDef JsonPageDefs_User[] = {
@@ -41,19 +41,19 @@
41
42 /*
43 ** Implements the /json/user family of pages/commands.
44 **
45 */
46 cson_value * json_page_user(){
47 return json_page_dispatch_helper(&JsonPageDefs_User[0]);
48 }
49
50
51 /*
52 ** Impl of /json/user/list. Requires admin/setup rights.
53 */
54 static cson_value * json_user_list(){
55 cson_value * payV = NULL;
56 Stmt q;
57 if(!g.perm.Admin && !g.perm.Setup){
58 json_set_err(FSL_JSON_E_DENIED,
59 "Requires 'a' or 's' privileges.");
@@ -122,11 +122,11 @@
122
123
124 /*
125 ** Impl of /json/user/get. Requires admin or setup rights.
126 */
127 static cson_value * json_user_get(){
128 cson_value * payV = NULL;
129 char const * pUser = NULL;
130 if(!g.perm.Admin && !g.perm.Setup){
131 json_set_err(FSL_JSON_E_DENIED,
132 "Requires 'a' or 's' privileges.");
@@ -393,11 +393,11 @@
393
394
395 /*
396 ** Impl of /json/user/save.
397 */
398 static cson_value * json_user_save(){
399 /* try to get user info from GET/CLI args and construct
400 a JSON form of it... */
401 cson_object * u = cson_new_object();
402 char const * str = NULL;
403 int b = -1;
404
--- src/json_user.c
+++ src/json_user.c
@@ -21,13 +21,13 @@
21
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26 static cson_value * json_user_get(void);
27 static cson_value * json_user_list(void);
28 static cson_value * json_user_save(void);
29
30 /*
31 ** Mapping of /json/user/XXX commands/paths to callbacks.
32 */
33 static const JsonPageDef JsonPageDefs_User[] = {
@@ -41,19 +41,19 @@
41
42 /*
43 ** Implements the /json/user family of pages/commands.
44 **
45 */
46 cson_value * json_page_user(void){
47 return json_page_dispatch_helper(&JsonPageDefs_User[0]);
48 }
49
50
51 /*
52 ** Impl of /json/user/list. Requires admin/setup rights.
53 */
54 static cson_value * json_user_list(void){
55 cson_value * payV = NULL;
56 Stmt q;
57 if(!g.perm.Admin && !g.perm.Setup){
58 json_set_err(FSL_JSON_E_DENIED,
59 "Requires 'a' or 's' privileges.");
@@ -122,11 +122,11 @@
122
123
124 /*
125 ** Impl of /json/user/get. Requires admin or setup rights.
126 */
127 static cson_value * json_user_get(void){
128 cson_value * payV = NULL;
129 char const * pUser = NULL;
130 if(!g.perm.Admin && !g.perm.Setup){
131 json_set_err(FSL_JSON_E_DENIED,
132 "Requires 'a' or 's' privileges.");
@@ -393,11 +393,11 @@
393
394
395 /*
396 ** Impl of /json/user/save.
397 */
398 static cson_value * json_user_save(void){
399 /* try to get user info from GET/CLI args and construct
400 a JSON form of it... */
401 cson_object * u = cson_new_object();
402 char const * str = NULL;
403 int b = -1;
404
+13 -13
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -21,16 +21,16 @@
2121
2222
#if INTERFACE
2323
#include "json_detail.h"
2424
#endif
2525
26
-static cson_value * json_wiki_create();
27
-static cson_value * json_wiki_get();
28
-static cson_value * json_wiki_list();
29
-static cson_value * json_wiki_preview();
30
-static cson_value * json_wiki_save();
31
-static cson_value * json_wiki_diff();
26
+static cson_value * json_wiki_create(void);
27
+static cson_value * json_wiki_get(void);
28
+static cson_value * json_wiki_list(void);
29
+static cson_value * json_wiki_preview(void);
30
+static cson_value * json_wiki_save(void);
31
+static cson_value * json_wiki_diff(void);
3232
/*
3333
** Mapping of /json/wiki/XXX commands/paths to callbacks.
3434
*/
3535
static const JsonPageDef JsonPageDefs_Wiki[] = {
3636
{"create", json_wiki_create, 0},
@@ -47,11 +47,11 @@
4747
4848
/*
4949
** Implements the /json/wiki family of pages/commands.
5050
**
5151
*/
52
-cson_value * json_page_wiki(){
52
+cson_value * json_page_wiki(void){
5353
return json_page_dispatch_helper(JsonPageDefs_Wiki);
5454
}
5555
5656
/*
5757
** Returns the UUID for the given wiki blob RID, or NULL if not
@@ -244,11 +244,11 @@
244244
245245
/*
246246
** Implementation of /json/wiki/get.
247247
**
248248
*/
249
-static cson_value * json_wiki_get(){
249
+static cson_value * json_wiki_get(void){
250250
char const * zPageName;
251251
char const * zSymName = NULL;
252252
int contentFormat = -1;
253253
if( !g.perm.RdWiki && !g.perm.Read ){
254254
json_set_err(FSL_JSON_E_DENIED,
@@ -274,11 +274,11 @@
274274
}
275275
276276
/*
277277
** Implementation of /json/wiki/preview.
278278
*/
279
-static cson_value * json_wiki_preview(){
279
+static cson_value * json_wiki_preview(void){
280280
char const * zContent = NULL;
281281
char const * zMime = NULL;
282282
cson_string * sContent = NULL;
283283
cson_value * pay = NULL;
284284
Blob contentOrig = empty_blob;
@@ -449,26 +449,26 @@
449449
}
450450
451451
/*
452452
** Implementation of /json/wiki/create.
453453
*/
454
-static cson_value * json_wiki_create(){
454
+static cson_value * json_wiki_create(void){
455455
return json_wiki_create_or_save(1,0);
456456
}
457457
458458
/*
459459
** Implementation of /json/wiki/save.
460460
*/
461
-static cson_value * json_wiki_save(){
461
+static cson_value * json_wiki_save(void){
462462
char const createIfNotExists = json_getenv_bool("createIfNotExists",0);
463463
return json_wiki_create_or_save(0,createIfNotExists);
464464
}
465465
466466
/*
467467
** Implementation of /json/wiki/list.
468468
*/
469
-static cson_value * json_wiki_list(){
469
+static cson_value * json_wiki_list(void){
470470
cson_value * listV = NULL;
471471
cson_array * list = NULL;
472472
char const * zGlob = NULL;
473473
Stmt q = empty_Stmt;
474474
Blob sql = empty_blob;
@@ -531,11 +531,11 @@
531531
end:
532532
db_finalize(&q);
533533
return listV;
534534
}
535535
536
-static cson_value * json_wiki_diff(){
536
+static cson_value * json_wiki_diff(void){
537537
char const * zV1 = NULL;
538538
char const * zV2 = NULL;
539539
cson_object * pay = NULL;
540540
int argPos = g.json.dispatchDepth;
541541
int r1 = 0, r2 = 0;
542542
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -21,16 +21,16 @@
21
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26 static cson_value * json_wiki_create();
27 static cson_value * json_wiki_get();
28 static cson_value * json_wiki_list();
29 static cson_value * json_wiki_preview();
30 static cson_value * json_wiki_save();
31 static cson_value * json_wiki_diff();
32 /*
33 ** Mapping of /json/wiki/XXX commands/paths to callbacks.
34 */
35 static const JsonPageDef JsonPageDefs_Wiki[] = {
36 {"create", json_wiki_create, 0},
@@ -47,11 +47,11 @@
47
48 /*
49 ** Implements the /json/wiki family of pages/commands.
50 **
51 */
52 cson_value * json_page_wiki(){
53 return json_page_dispatch_helper(JsonPageDefs_Wiki);
54 }
55
56 /*
57 ** Returns the UUID for the given wiki blob RID, or NULL if not
@@ -244,11 +244,11 @@
244
245 /*
246 ** Implementation of /json/wiki/get.
247 **
248 */
249 static cson_value * json_wiki_get(){
250 char const * zPageName;
251 char const * zSymName = NULL;
252 int contentFormat = -1;
253 if( !g.perm.RdWiki && !g.perm.Read ){
254 json_set_err(FSL_JSON_E_DENIED,
@@ -274,11 +274,11 @@
274 }
275
276 /*
277 ** Implementation of /json/wiki/preview.
278 */
279 static cson_value * json_wiki_preview(){
280 char const * zContent = NULL;
281 char const * zMime = NULL;
282 cson_string * sContent = NULL;
283 cson_value * pay = NULL;
284 Blob contentOrig = empty_blob;
@@ -449,26 +449,26 @@
449 }
450
451 /*
452 ** Implementation of /json/wiki/create.
453 */
454 static cson_value * json_wiki_create(){
455 return json_wiki_create_or_save(1,0);
456 }
457
458 /*
459 ** Implementation of /json/wiki/save.
460 */
461 static cson_value * json_wiki_save(){
462 char const createIfNotExists = json_getenv_bool("createIfNotExists",0);
463 return json_wiki_create_or_save(0,createIfNotExists);
464 }
465
466 /*
467 ** Implementation of /json/wiki/list.
468 */
469 static cson_value * json_wiki_list(){
470 cson_value * listV = NULL;
471 cson_array * list = NULL;
472 char const * zGlob = NULL;
473 Stmt q = empty_Stmt;
474 Blob sql = empty_blob;
@@ -531,11 +531,11 @@
531 end:
532 db_finalize(&q);
533 return listV;
534 }
535
536 static cson_value * json_wiki_diff(){
537 char const * zV1 = NULL;
538 char const * zV2 = NULL;
539 cson_object * pay = NULL;
540 int argPos = g.json.dispatchDepth;
541 int r1 = 0, r2 = 0;
542
--- src/json_wiki.c
+++ src/json_wiki.c
@@ -21,16 +21,16 @@
21
22 #if INTERFACE
23 #include "json_detail.h"
24 #endif
25
26 static cson_value * json_wiki_create(void);
27 static cson_value * json_wiki_get(void);
28 static cson_value * json_wiki_list(void);
29 static cson_value * json_wiki_preview(void);
30 static cson_value * json_wiki_save(void);
31 static cson_value * json_wiki_diff(void);
32 /*
33 ** Mapping of /json/wiki/XXX commands/paths to callbacks.
34 */
35 static const JsonPageDef JsonPageDefs_Wiki[] = {
36 {"create", json_wiki_create, 0},
@@ -47,11 +47,11 @@
47
48 /*
49 ** Implements the /json/wiki family of pages/commands.
50 **
51 */
52 cson_value * json_page_wiki(void){
53 return json_page_dispatch_helper(JsonPageDefs_Wiki);
54 }
55
56 /*
57 ** Returns the UUID for the given wiki blob RID, or NULL if not
@@ -244,11 +244,11 @@
244
245 /*
246 ** Implementation of /json/wiki/get.
247 **
248 */
249 static cson_value * json_wiki_get(void){
250 char const * zPageName;
251 char const * zSymName = NULL;
252 int contentFormat = -1;
253 if( !g.perm.RdWiki && !g.perm.Read ){
254 json_set_err(FSL_JSON_E_DENIED,
@@ -274,11 +274,11 @@
274 }
275
276 /*
277 ** Implementation of /json/wiki/preview.
278 */
279 static cson_value * json_wiki_preview(void){
280 char const * zContent = NULL;
281 char const * zMime = NULL;
282 cson_string * sContent = NULL;
283 cson_value * pay = NULL;
284 Blob contentOrig = empty_blob;
@@ -449,26 +449,26 @@
449 }
450
451 /*
452 ** Implementation of /json/wiki/create.
453 */
454 static cson_value * json_wiki_create(void){
455 return json_wiki_create_or_save(1,0);
456 }
457
458 /*
459 ** Implementation of /json/wiki/save.
460 */
461 static cson_value * json_wiki_save(void){
462 char const createIfNotExists = json_getenv_bool("createIfNotExists",0);
463 return json_wiki_create_or_save(0,createIfNotExists);
464 }
465
466 /*
467 ** Implementation of /json/wiki/list.
468 */
469 static cson_value * json_wiki_list(void){
470 cson_value * listV = NULL;
471 cson_array * list = NULL;
472 char const * zGlob = NULL;
473 Stmt q = empty_Stmt;
474 Blob sql = empty_blob;
@@ -531,11 +531,11 @@
531 end:
532 db_finalize(&q);
533 return listV;
534 }
535
536 static cson_value * json_wiki_diff(void){
537 char const * zV1 = NULL;
538 char const * zV2 = NULL;
539 cson_object * pay = NULL;
540 int argPos = g.json.dispatchDepth;
541 int r1 = 0, r2 = 0;
542

Keyboard Shortcuts

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