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.)
Commit
632dfd26dda2fa1cf8ac90415c559174df81fef81ba29f3ba723551f0e9af659
Parent
29e5bb008c83265…
12 files changed
+2
-2
+5
-5
+2
-2
+1
-1
+4
-4
+1
-1
+4
-4
+1
-1
+11
-11
+9
-9
+7
-7
+13
-13
+2
-2
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -246,11 +246,11 @@ | ||
| 246 | 246 | ** If the "format" (CLI: -f) flag is set function returns the same as |
| 247 | 247 | ** json_wiki_get_content_format_flag(), else it returns true (non-0) |
| 248 | 248 | ** if either the includeContent (HTTP) or -content|-c boolean flags |
| 249 | 249 | ** (CLI) are set. |
| 250 | 250 | */ |
| 251 | -static int json_artifact_get_content_format_flag(){ | |
| 251 | +static int json_artifact_get_content_format_flag(void){ | |
| 252 | 252 | enum { MagicValue = -9 }; |
| 253 | 253 | int contentFormat = json_wiki_get_content_format_flag(MagicValue); |
| 254 | 254 | if(MagicValue == contentFormat){ |
| 255 | 255 | contentFormat = json_find_option_bool("includeContent","content","c",0) /* deprecated */ ? -1 : 0; |
| 256 | 256 | } |
| @@ -398,11 +398,11 @@ | ||
| 398 | 398 | |
| 399 | 399 | /* |
| 400 | 400 | ** Impl of /json/artifact. This basically just determines the type of |
| 401 | 401 | ** an artifact and forwards the real work to another function. |
| 402 | 402 | */ |
| 403 | -cson_value * json_page_artifact(){ | |
| 403 | +cson_value * json_page_artifact(void){ | |
| 404 | 404 | cson_object * pay = NULL; |
| 405 | 405 | char const * zName = NULL; |
| 406 | 406 | char const * zType = NULL; |
| 407 | 407 | char const * zUuid = NULL; |
| 408 | 408 | cson_value * entry = NULL; |
| 409 | 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(){ |
| 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 |
+5
-5
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -22,12 +22,12 @@ | ||
| 22 | 22 | #if INTERFACE |
| 23 | 23 | #include "json_detail.h" |
| 24 | 24 | #endif |
| 25 | 25 | |
| 26 | 26 | |
| 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); | |
| 29 | 29 | /* |
| 30 | 30 | ** Mapping of /json/branch/XXX commands/paths to callbacks. |
| 31 | 31 | */ |
| 32 | 32 | static const JsonPageDef JsonPageDefs_Branch[] = { |
| 33 | 33 | {"create", json_branch_create, 0}, |
| @@ -40,11 +40,11 @@ | ||
| 40 | 40 | /* |
| 41 | 41 | ** Implements the /json/branch family of pages/commands. Far from |
| 42 | 42 | ** complete. |
| 43 | 43 | ** |
| 44 | 44 | */ |
| 45 | -cson_value * json_page_branch(){ | |
| 45 | +cson_value * json_page_branch(void){ | |
| 46 | 46 | return json_page_dispatch_helper(&JsonPageDefs_Branch[0]); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /* |
| 50 | 50 | ** Impl for /json/branch/list |
| @@ -60,11 +60,11 @@ | ||
| 60 | 60 | ** HTTP mode options: |
| 61 | 61 | ** |
| 62 | 62 | ** "range" GET/POST.payload parameter. FIXME: currently we also use |
| 63 | 63 | ** POST, but really want to restrict this to POST.payload. |
| 64 | 64 | */ |
| 65 | -static cson_value * json_branch_list(){ | |
| 65 | +static cson_value * json_branch_list(void){ | |
| 66 | 66 | cson_value * payV; |
| 67 | 67 | cson_object * pay; |
| 68 | 68 | cson_value * listV; |
| 69 | 69 | cson_array * list; |
| 70 | 70 | char const * range = NULL; |
| @@ -313,11 +313,11 @@ | ||
| 313 | 313 | |
| 314 | 314 | |
| 315 | 315 | /* |
| 316 | 316 | ** Impl of /json/branch/create. |
| 317 | 317 | */ |
| 318 | -static cson_value * json_branch_create(){ | |
| 318 | +static cson_value * json_branch_create(void){ | |
| 319 | 319 | cson_value * payV = NULL; |
| 320 | 320 | cson_object * pay = NULL; |
| 321 | 321 | int rc = 0; |
| 322 | 322 | BranchCreateOptions opt; |
| 323 | 323 | char * zUuid = NULL; |
| 324 | 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(); |
| 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 |
+2
-2
| --- src/json_detail.h | ||
| +++ src/json_detail.h | ||
| @@ -149,11 +149,11 @@ | ||
| 149 | 149 | ** almost certainly will corrupt any HTTP response headers. Output |
| 150 | 150 | ** sent to stderr ends up in my apache log, so that might be useful |
| 151 | 151 | ** for debugging in some cases, but no such code should be left |
| 152 | 152 | ** enabled for non-debugging builds. |
| 153 | 153 | */ |
| 154 | -typedef cson_value * (*fossil_json_f)(); | |
| 154 | +typedef cson_value * (*fossil_json_f)(void); | |
| 155 | 155 | |
| 156 | 156 | /* |
| 157 | 157 | ** Holds name-to-function mappings for JSON page/command dispatching. |
| 158 | 158 | ** |
| 159 | 159 | ** Internally we model page dispatching lists as arrays of these |
| @@ -260,14 +260,14 @@ | ||
| 260 | 260 | ** |
| 261 | 261 | ** Whether or not we need to take args from CLI or POST data makes a |
| 262 | 262 | ** difference in argument/parameter handling in many JSON routines, |
| 263 | 263 | ** and thus this distinction. |
| 264 | 264 | */ |
| 265 | -int fossil_has_json(); | |
| 265 | +int fossil_has_json(void); | |
| 266 | 266 | |
| 267 | 267 | enum json_get_changed_files_flags { |
| 268 | 268 | json_get_changed_files_ELIDE_PARENT = 1 << 0 |
| 269 | 269 | }; |
| 270 | 270 | |
| 271 | 271 | #endif /* !defined(_RC_COMPILE_) */ |
| 272 | 272 | #endif/*FOSSIL_JSON_DETAIL_H_INCLUDED*/ |
| 273 | 273 | #endif /* FOSSIL_ENABLE_JSON */ |
| 274 | 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)(); |
| 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 @@ | ||
| 83 | 83 | ** |
| 84 | 84 | ** Can come from GET, POST.payload, CLI -v1/-v2 or as positional |
| 85 | 85 | ** parameters following the command name (in HTTP and CLI modes). |
| 86 | 86 | ** |
| 87 | 87 | */ |
| 88 | -cson_value * json_page_diff(){ | |
| 88 | +cson_value * json_page_diff(void){ | |
| 89 | 89 | cson_object * pay = NULL; |
| 90 | 90 | cson_value * v = NULL; |
| 91 | 91 | char const * zFrom; |
| 92 | 92 | char const * zTo; |
| 93 | 93 | int nContext = 0; |
| 94 | 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(){ |
| 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 @@ | ||
| 21 | 21 | |
| 22 | 22 | #if INTERFACE |
| 23 | 23 | #include "json_detail.h" |
| 24 | 24 | #endif |
| 25 | 25 | |
| 26 | -static cson_value * json_page_dir_list(); | |
| 26 | +static cson_value * json_page_dir_list(void); | |
| 27 | 27 | /* |
| 28 | 28 | ** Mapping of /json/wiki/XXX commands/paths to callbacks. |
| 29 | 29 | */ |
| 30 | 30 | #if 0 /* TODO: Not used? */ |
| 31 | 31 | static const JsonPageDef JsonPageDefs_Dir[] = { |
| @@ -33,11 +33,11 @@ | ||
| 33 | 33 | {NULL,NULL,0} |
| 34 | 34 | }; |
| 35 | 35 | #endif |
| 36 | 36 | |
| 37 | 37 | #if 0 /* TODO: Not used? */ |
| 38 | -static char const * json_dir_path_extra(){ | |
| 38 | +static char const * json_dir_path_extra(void){ | |
| 39 | 39 | static char const * zP = NULL; |
| 40 | 40 | if( !zP ){ |
| 41 | 41 | zP = g.zExtra; |
| 42 | 42 | while(zP && *zP && ('/'==*zP)){ |
| 43 | 43 | ++zP; |
| @@ -49,11 +49,11 @@ | ||
| 49 | 49 | |
| 50 | 50 | /* |
| 51 | 51 | ** Impl of /json/dir. 98% of it was taken directly |
| 52 | 52 | ** from browse.c::page_dir() |
| 53 | 53 | */ |
| 54 | -static cson_value * json_page_dir_list(){ | |
| 54 | +static cson_value * json_page_dir_list(void){ | |
| 55 | 55 | cson_object * zPayload = NULL; /* return value */ |
| 56 | 56 | cson_array * zEntries = NULL; /* accumulated list of entries. */ |
| 57 | 57 | cson_object * zEntry = NULL; /* a single dir/file entry. */ |
| 58 | 58 | cson_array * keyStore = NULL; /* garbage collector for shared strings. */ |
| 59 | 59 | cson_string * zKeyName = NULL; |
| @@ -281,14 +281,14 @@ | ||
| 281 | 281 | |
| 282 | 282 | /* |
| 283 | 283 | ** Implements the /json/dir family of pages/commands. |
| 284 | 284 | ** |
| 285 | 285 | */ |
| 286 | -cson_value * json_page_dir(){ | |
| 286 | +cson_value * json_page_dir(void){ | |
| 287 | 287 | #if 1 |
| 288 | 288 | return json_page_dir_list(); |
| 289 | 289 | #else |
| 290 | 290 | return json_page_dispatch_helper(&JsonPageDefs_Dir[0]); |
| 291 | 291 | #endif |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | #endif /* FOSSIL_ENABLE_JSON */ |
| 295 | 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(); |
| 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 |
+1
-1
| --- src/json_finfo.c | ||
| +++ src/json_finfo.c | ||
| @@ -25,11 +25,11 @@ | ||
| 25 | 25 | |
| 26 | 26 | /* |
| 27 | 27 | ** Implements the /json/finfo page/command. |
| 28 | 28 | ** |
| 29 | 29 | */ |
| 30 | -cson_value * json_page_finfo(){ | |
| 30 | +cson_value * json_page_finfo(void){ | |
| 31 | 31 | cson_object * pay = NULL; |
| 32 | 32 | cson_array * checkins = NULL; |
| 33 | 33 | char const * zFilename = NULL; |
| 34 | 34 | Blob sql = empty_blob; |
| 35 | 35 | Stmt q = empty_Stmt; |
| 36 | 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(){ |
| 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 |
+4
-4
| --- src/json_login.c | ||
| +++ src/json_login.c | ||
| @@ -26,11 +26,11 @@ | ||
| 26 | 26 | |
| 27 | 27 | /* |
| 28 | 28 | ** Implementation of the /json/login page. |
| 29 | 29 | ** |
| 30 | 30 | */ |
| 31 | -cson_value * json_page_login(){ | |
| 31 | +cson_value * json_page_login(void){ | |
| 32 | 32 | char preciseErrors = /* if true, "complete" JSON error codes are used, |
| 33 | 33 | else they are "dumbed down" to a generic login |
| 34 | 34 | error code. |
| 35 | 35 | */ |
| 36 | 36 | #if 1 |
| @@ -181,11 +181,11 @@ | ||
| 181 | 181 | |
| 182 | 182 | /* |
| 183 | 183 | ** Impl of /json/logout. |
| 184 | 184 | ** |
| 185 | 185 | */ |
| 186 | -cson_value * json_page_logout(){ | |
| 186 | +cson_value * json_page_logout(void){ | |
| 187 | 187 | cson_value const *token = g.json.authToken; |
| 188 | 188 | /* Remember that json_bootstrap_late() replaces the login cookie |
| 189 | 189 | with the JSON auth token if the request contains it. If the |
| 190 | 190 | request is missing the auth token then this will fetch fossil's |
| 191 | 191 | original cookie. Either way, it's what we want :). |
| @@ -207,11 +207,11 @@ | ||
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | /* |
| 210 | 210 | ** Implementation of the /json/anonymousPassword page. |
| 211 | 211 | */ |
| 212 | -cson_value * json_page_anon_password(){ | |
| 212 | +cson_value * json_page_anon_password(void){ | |
| 213 | 213 | cson_value * v = cson_value_new_object(); |
| 214 | 214 | cson_object * o = cson_value_get_object(v); |
| 215 | 215 | unsigned const int seed = captcha_seed(); |
| 216 | 216 | char const * zCaptcha = captcha_decode(seed); |
| 217 | 217 | cson_object_set(o, "seed", |
| @@ -226,11 +226,11 @@ | ||
| 226 | 226 | |
| 227 | 227 | |
| 228 | 228 | /* |
| 229 | 229 | ** Implements the /json/whoami page/command. |
| 230 | 230 | */ |
| 231 | -cson_value * json_page_whoami(){ | |
| 231 | +cson_value * json_page_whoami(void){ | |
| 232 | 232 | cson_value * payload = NULL; |
| 233 | 233 | cson_object * obj = NULL; |
| 234 | 234 | Stmt q; |
| 235 | 235 | if(!g.json.authToken && g.userUid==0){ |
| 236 | 236 | /* assume we just logged out. */ |
| 237 | 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(){ |
| 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 |
+1
-1
| --- src/json_query.c | ||
| +++ src/json_query.c | ||
| @@ -38,11 +38,11 @@ | ||
| 38 | 38 | ** (default) creates each row as an Object. |
| 39 | 39 | ** |
| 40 | 40 | ** TODO: in CLI mode (only) use -S FILENAME to read the sql |
| 41 | 41 | ** from a file. |
| 42 | 42 | */ |
| 43 | -cson_value * json_page_query(){ | |
| 43 | +cson_value * json_page_query(void){ | |
| 44 | 44 | char const * zSql = NULL; |
| 45 | 45 | cson_value * payV; |
| 46 | 46 | char const * zFmt; |
| 47 | 47 | Stmt q = empty_Stmt; |
| 48 | 48 | int check; |
| 49 | 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(){ |
| 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 @@ | ||
| 22 | 22 | #if INTERFACE |
| 23 | 23 | #include "json_detail.h" |
| 24 | 24 | #endif |
| 25 | 25 | |
| 26 | 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(); | |
| 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 | 32 | |
| 33 | 33 | /* |
| 34 | 34 | ** Mapping of /json/report/XXX commands/paths to callbacks. |
| 35 | 35 | */ |
| 36 | 36 | static const JsonPageDef JsonPageDefs_Report[] = { |
| @@ -45,11 +45,11 @@ | ||
| 45 | 45 | /* |
| 46 | 46 | ** Implementation of the /json/report page. |
| 47 | 47 | ** |
| 48 | 48 | ** |
| 49 | 49 | */ |
| 50 | -cson_value * json_page_report(){ | |
| 50 | +cson_value * json_page_report(void){ | |
| 51 | 51 | if(!g.perm.RdTkt && !g.perm.NewTkt ){ |
| 52 | 52 | json_set_err(FSL_JSON_E_DENIED, |
| 53 | 53 | "Requires 'r' or 'n' permissions."); |
| 54 | 54 | return NULL; |
| 55 | 55 | } |
| @@ -77,16 +77,16 @@ | ||
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | return nReport; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | -static cson_value * json_report_create(){ | |
| 82 | +static cson_value * json_report_create(void){ | |
| 83 | 83 | json_set_err(FSL_JSON_E_NYI, NULL); |
| 84 | 84 | return NULL; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | -static cson_value * json_report_get(){ | |
| 87 | +static cson_value * json_report_get(void){ | |
| 88 | 88 | int nReport; |
| 89 | 89 | Stmt q = empty_Stmt; |
| 90 | 90 | cson_value * pay = NULL; |
| 91 | 91 | |
| 92 | 92 | if(!g.perm.TktFmt){ |
| @@ -122,11 +122,11 @@ | ||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /* |
| 125 | 125 | ** Impl of /json/report/list. |
| 126 | 126 | */ |
| 127 | -static cson_value * json_report_list(){ | |
| 127 | +static cson_value * json_report_list(void){ | |
| 128 | 128 | Blob sql = empty_blob; |
| 129 | 129 | cson_value * pay = NULL; |
| 130 | 130 | if(!g.perm.RdTkt){ |
| 131 | 131 | json_set_err(FSL_JSON_E_DENIED, |
| 132 | 132 | "Requires 'r' privileges."); |
| @@ -158,11 +158,11 @@ | ||
| 158 | 158 | ** limit=int (CLI: -limit # or -n #) -n is for compat. with other commands. |
| 159 | 159 | ** |
| 160 | 160 | ** format=a|o Specifies result format: a=each row is an arry, o=each |
| 161 | 161 | ** row is an object. Default=o. |
| 162 | 162 | */ |
| 163 | -static cson_value * json_report_run(){ | |
| 163 | +static cson_value * json_report_run(void){ | |
| 164 | 164 | int nReport; |
| 165 | 165 | Stmt q = empty_Stmt; |
| 166 | 166 | cson_object * pay = NULL; |
| 167 | 167 | cson_array * tktList = NULL; |
| 168 | 168 | char const * zFmt; |
| @@ -255,9 +255,9 @@ | ||
| 255 | 255 | |
| 256 | 256 | return pay ? cson_object_value(pay) : NULL; |
| 257 | 257 | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | -static cson_value * json_report_save(){ | |
| 260 | +static cson_value * json_report_save(void){ | |
| 261 | 261 | return NULL; |
| 262 | 262 | } |
| 263 | 263 | #endif /* FOSSIL_ENABLE_JSON */ |
| 264 | 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(); |
| 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 |
+9
-9
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -22,13 +22,13 @@ | ||
| 22 | 22 | |
| 23 | 23 | #if INTERFACE |
| 24 | 24 | #include "json_detail.h" |
| 25 | 25 | #endif |
| 26 | 26 | |
| 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); | |
| 30 | 30 | /* |
| 31 | 31 | ** Mapping of /json/timeline/XXX commands/paths to callbacks. |
| 32 | 32 | */ |
| 33 | 33 | static const JsonPageDef JsonPageDefs_Timeline[] = { |
| 34 | 34 | /* the short forms are only enabled in CLI mode, to avoid |
| @@ -49,11 +49,11 @@ | ||
| 49 | 49 | /* |
| 50 | 50 | ** Implements the /json/timeline family of pages/commands. Far from |
| 51 | 51 | ** complete. |
| 52 | 52 | ** |
| 53 | 53 | */ |
| 54 | -cson_value * json_page_timeline(){ | |
| 54 | +cson_value * json_page_timeline(void){ | |
| 55 | 55 | #if 0 |
| 56 | 56 | /* The original timeline code does not require 'h' access, |
| 57 | 57 | but it arguably should. For JSON mode i think one could argue |
| 58 | 58 | that History permissions are required. |
| 59 | 59 | */ |
| @@ -364,11 +364,11 @@ | ||
| 364 | 364 | } |
| 365 | 365 | db_finalize(&q); |
| 366 | 366 | return rowsV; |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | -static cson_value * json_timeline_branch(){ | |
| 369 | +static cson_value * json_timeline_branch(void){ | |
| 370 | 370 | cson_value * pay = NULL; |
| 371 | 371 | Blob sql = empty_blob; |
| 372 | 372 | Stmt q = empty_Stmt; |
| 373 | 373 | int limit = 0; |
| 374 | 374 | if(!g.perm.Read){ |
| @@ -445,11 +445,11 @@ | ||
| 445 | 445 | ** Implementation of /json/timeline/ci. |
| 446 | 446 | ** |
| 447 | 447 | ** Still a few TODOs (like figuring out how to structure |
| 448 | 448 | ** inheritance info). |
| 449 | 449 | */ |
| 450 | -static cson_value * json_timeline_ci(){ | |
| 450 | +static cson_value * json_timeline_ci(void){ | |
| 451 | 451 | cson_value * payV = NULL; |
| 452 | 452 | cson_object * pay = NULL; |
| 453 | 453 | cson_value * tmp = NULL; |
| 454 | 454 | cson_value * listV = NULL; |
| 455 | 455 | cson_array * list = NULL; |
| @@ -526,11 +526,11 @@ | ||
| 526 | 526 | |
| 527 | 527 | /* |
| 528 | 528 | ** Implementation of /json/timeline/event. |
| 529 | 529 | ** |
| 530 | 530 | */ |
| 531 | -cson_value * json_timeline_event(){ | |
| 531 | +cson_value * json_timeline_event(void){ | |
| 532 | 532 | /* This code is 95% the same as json_timeline_ci(), by the way. */ |
| 533 | 533 | cson_value * payV = NULL; |
| 534 | 534 | cson_object * pay = NULL; |
| 535 | 535 | cson_array * list = NULL; |
| 536 | 536 | int check = 0; |
| @@ -582,11 +582,11 @@ | ||
| 582 | 582 | |
| 583 | 583 | /* |
| 584 | 584 | ** Implementation of /json/timeline/wiki. |
| 585 | 585 | ** |
| 586 | 586 | */ |
| 587 | -cson_value * json_timeline_wiki(){ | |
| 587 | +cson_value * json_timeline_wiki(void){ | |
| 588 | 588 | /* This code is 95% the same as json_timeline_ci(), by the way. */ |
| 589 | 589 | cson_value * payV = NULL; |
| 590 | 590 | cson_object * pay = NULL; |
| 591 | 591 | cson_array * list = NULL; |
| 592 | 592 | int check = 0; |
| @@ -643,11 +643,11 @@ | ||
| 643 | 643 | |
| 644 | 644 | /* |
| 645 | 645 | ** Implementation of /json/timeline/ticket. |
| 646 | 646 | ** |
| 647 | 647 | */ |
| 648 | -static cson_value * json_timeline_ticket(){ | |
| 648 | +static cson_value * json_timeline_ticket(void){ | |
| 649 | 649 | /* This code is 95% the same as json_timeline_ci(), by the way. */ |
| 650 | 650 | cson_value * payV = NULL; |
| 651 | 651 | cson_object * pay = NULL; |
| 652 | 652 | cson_value * tmp = NULL; |
| 653 | 653 | cson_value * listV = NULL; |
| 654 | 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(); |
| 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 @@ | ||
| 21 | 21 | |
| 22 | 22 | #if INTERFACE |
| 23 | 23 | #include "json_detail.h" |
| 24 | 24 | #endif |
| 25 | 25 | |
| 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); | |
| 29 | 29 | |
| 30 | 30 | /* |
| 31 | 31 | ** Mapping of /json/user/XXX commands/paths to callbacks. |
| 32 | 32 | */ |
| 33 | 33 | static const JsonPageDef JsonPageDefs_User[] = { |
| @@ -41,19 +41,19 @@ | ||
| 41 | 41 | |
| 42 | 42 | /* |
| 43 | 43 | ** Implements the /json/user family of pages/commands. |
| 44 | 44 | ** |
| 45 | 45 | */ |
| 46 | -cson_value * json_page_user(){ | |
| 46 | +cson_value * json_page_user(void){ | |
| 47 | 47 | return json_page_dispatch_helper(&JsonPageDefs_User[0]); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | /* |
| 52 | 52 | ** Impl of /json/user/list. Requires admin/setup rights. |
| 53 | 53 | */ |
| 54 | -static cson_value * json_user_list(){ | |
| 54 | +static cson_value * json_user_list(void){ | |
| 55 | 55 | cson_value * payV = NULL; |
| 56 | 56 | Stmt q; |
| 57 | 57 | if(!g.perm.Admin && !g.perm.Setup){ |
| 58 | 58 | json_set_err(FSL_JSON_E_DENIED, |
| 59 | 59 | "Requires 'a' or 's' privileges."); |
| @@ -122,11 +122,11 @@ | ||
| 122 | 122 | |
| 123 | 123 | |
| 124 | 124 | /* |
| 125 | 125 | ** Impl of /json/user/get. Requires admin or setup rights. |
| 126 | 126 | */ |
| 127 | -static cson_value * json_user_get(){ | |
| 127 | +static cson_value * json_user_get(void){ | |
| 128 | 128 | cson_value * payV = NULL; |
| 129 | 129 | char const * pUser = NULL; |
| 130 | 130 | if(!g.perm.Admin && !g.perm.Setup){ |
| 131 | 131 | json_set_err(FSL_JSON_E_DENIED, |
| 132 | 132 | "Requires 'a' or 's' privileges."); |
| @@ -393,11 +393,11 @@ | ||
| 393 | 393 | |
| 394 | 394 | |
| 395 | 395 | /* |
| 396 | 396 | ** Impl of /json/user/save. |
| 397 | 397 | */ |
| 398 | -static cson_value * json_user_save(){ | |
| 398 | +static cson_value * json_user_save(void){ | |
| 399 | 399 | /* try to get user info from GET/CLI args and construct |
| 400 | 400 | a JSON form of it... */ |
| 401 | 401 | cson_object * u = cson_new_object(); |
| 402 | 402 | char const * str = NULL; |
| 403 | 403 | int b = -1; |
| 404 | 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(); |
| 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 @@ | ||
| 21 | 21 | |
| 22 | 22 | #if INTERFACE |
| 23 | 23 | #include "json_detail.h" |
| 24 | 24 | #endif |
| 25 | 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(); | |
| 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 | 32 | /* |
| 33 | 33 | ** Mapping of /json/wiki/XXX commands/paths to callbacks. |
| 34 | 34 | */ |
| 35 | 35 | static const JsonPageDef JsonPageDefs_Wiki[] = { |
| 36 | 36 | {"create", json_wiki_create, 0}, |
| @@ -47,11 +47,11 @@ | ||
| 47 | 47 | |
| 48 | 48 | /* |
| 49 | 49 | ** Implements the /json/wiki family of pages/commands. |
| 50 | 50 | ** |
| 51 | 51 | */ |
| 52 | -cson_value * json_page_wiki(){ | |
| 52 | +cson_value * json_page_wiki(void){ | |
| 53 | 53 | return json_page_dispatch_helper(JsonPageDefs_Wiki); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /* |
| 57 | 57 | ** Returns the UUID for the given wiki blob RID, or NULL if not |
| @@ -244,11 +244,11 @@ | ||
| 244 | 244 | |
| 245 | 245 | /* |
| 246 | 246 | ** Implementation of /json/wiki/get. |
| 247 | 247 | ** |
| 248 | 248 | */ |
| 249 | -static cson_value * json_wiki_get(){ | |
| 249 | +static cson_value * json_wiki_get(void){ | |
| 250 | 250 | char const * zPageName; |
| 251 | 251 | char const * zSymName = NULL; |
| 252 | 252 | int contentFormat = -1; |
| 253 | 253 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 254 | 254 | json_set_err(FSL_JSON_E_DENIED, |
| @@ -274,11 +274,11 @@ | ||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | /* |
| 277 | 277 | ** Implementation of /json/wiki/preview. |
| 278 | 278 | */ |
| 279 | -static cson_value * json_wiki_preview(){ | |
| 279 | +static cson_value * json_wiki_preview(void){ | |
| 280 | 280 | char const * zContent = NULL; |
| 281 | 281 | char const * zMime = NULL; |
| 282 | 282 | cson_string * sContent = NULL; |
| 283 | 283 | cson_value * pay = NULL; |
| 284 | 284 | Blob contentOrig = empty_blob; |
| @@ -449,26 +449,26 @@ | ||
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | /* |
| 452 | 452 | ** Implementation of /json/wiki/create. |
| 453 | 453 | */ |
| 454 | -static cson_value * json_wiki_create(){ | |
| 454 | +static cson_value * json_wiki_create(void){ | |
| 455 | 455 | return json_wiki_create_or_save(1,0); |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | /* |
| 459 | 459 | ** Implementation of /json/wiki/save. |
| 460 | 460 | */ |
| 461 | -static cson_value * json_wiki_save(){ | |
| 461 | +static cson_value * json_wiki_save(void){ | |
| 462 | 462 | char const createIfNotExists = json_getenv_bool("createIfNotExists",0); |
| 463 | 463 | return json_wiki_create_or_save(0,createIfNotExists); |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | /* |
| 467 | 467 | ** Implementation of /json/wiki/list. |
| 468 | 468 | */ |
| 469 | -static cson_value * json_wiki_list(){ | |
| 469 | +static cson_value * json_wiki_list(void){ | |
| 470 | 470 | cson_value * listV = NULL; |
| 471 | 471 | cson_array * list = NULL; |
| 472 | 472 | char const * zGlob = NULL; |
| 473 | 473 | Stmt q = empty_Stmt; |
| 474 | 474 | Blob sql = empty_blob; |
| @@ -531,11 +531,11 @@ | ||
| 531 | 531 | end: |
| 532 | 532 | db_finalize(&q); |
| 533 | 533 | return listV; |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | -static cson_value * json_wiki_diff(){ | |
| 536 | +static cson_value * json_wiki_diff(void){ | |
| 537 | 537 | char const * zV1 = NULL; |
| 538 | 538 | char const * zV2 = NULL; |
| 539 | 539 | cson_object * pay = NULL; |
| 540 | 540 | int argPos = g.json.dispatchDepth; |
| 541 | 541 | int r1 = 0, r2 = 0; |
| 542 | 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(); |
| 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 |