Fossil SCM
minor cleanups.
Commit
6ee6486e02c584f8fca772423c531ad45a6da584
Parent
ccd66b9b3ca4797…
2 files changed
+7
-2
+3
-3
+7
-2
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -188,16 +188,21 @@ | ||
| 188 | 188 | limit = json_timeline_limit(); |
| 189 | 189 | if(limit){ |
| 190 | 190 | blob_appendf(pSql,"LIMIT %d ",limit); |
| 191 | 191 | } |
| 192 | 192 | if(pPayload){ |
| 193 | - cson_object_set(pPayload, "limit",cson_value_new_integer(limit)); | |
| 193 | + cson_object_set(pPayload, "limit",json_new_int(limit)); | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | -static cson_value * json_timeline_get_changed_files(int rid){ | |
| 198 | +/* | |
| 199 | +** If any files are associated with the given rid, a JSON array | |
| 200 | +** containing information about them is returned (and is owned by the | |
| 201 | +** caller). If no files are associated with it then NULL is returned. | |
| 202 | +*/ | |
| 203 | +cson_value * json_timeline_get_changed_files(int rid){ | |
| 199 | 204 | cson_value * rowsV = NULL; |
| 200 | 205 | cson_array * rows = NULL; |
| 201 | 206 | Stmt q; |
| 202 | 207 | db_prepare(&q, |
| 203 | 208 | #if 0 |
| 204 | 209 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -188,16 +188,21 @@ | |
| 188 | limit = json_timeline_limit(); |
| 189 | if(limit){ |
| 190 | blob_appendf(pSql,"LIMIT %d ",limit); |
| 191 | } |
| 192 | if(pPayload){ |
| 193 | cson_object_set(pPayload, "limit",cson_value_new_integer(limit)); |
| 194 | } |
| 195 | |
| 196 | } |
| 197 | |
| 198 | static cson_value * json_timeline_get_changed_files(int rid){ |
| 199 | cson_value * rowsV = NULL; |
| 200 | cson_array * rows = NULL; |
| 201 | Stmt q; |
| 202 | db_prepare(&q, |
| 203 | #if 0 |
| 204 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -188,16 +188,21 @@ | |
| 188 | limit = json_timeline_limit(); |
| 189 | if(limit){ |
| 190 | blob_appendf(pSql,"LIMIT %d ",limit); |
| 191 | } |
| 192 | if(pPayload){ |
| 193 | cson_object_set(pPayload, "limit",json_new_int(limit)); |
| 194 | } |
| 195 | |
| 196 | } |
| 197 | |
| 198 | /* |
| 199 | ** If any files are associated with the given rid, a JSON array |
| 200 | ** containing information about them is returned (and is owned by the |
| 201 | ** caller). If no files are associated with it then NULL is returned. |
| 202 | */ |
| 203 | cson_value * json_timeline_get_changed_files(int rid){ |
| 204 | cson_value * rowsV = NULL; |
| 205 | cson_array * rows = NULL; |
| 206 | Stmt q; |
| 207 | db_prepare(&q, |
| 208 | #if 0 |
| 209 |
+3
-3
| --- src/json_wiki.c | ||
| +++ src/json_wiki.c | ||
| @@ -101,11 +101,11 @@ | ||
| 101 | 101 | cson_object * pay = cson_value_get_object(payV); |
| 102 | 102 | cson_object_set(pay,"name",json_new_string(zPageName)); |
| 103 | 103 | cson_object_set(pay,"uuid",json_new_string(zUuid)); |
| 104 | 104 | free(zUuid); |
| 105 | 105 | zUuid = NULL; |
| 106 | - cson_object_set(pay,"rid",cson_value_new_integer((cson_int_t)rid)); | |
| 106 | + cson_object_set(pay,"rid",json_new_int((cson_int_t)rid)); | |
| 107 | 107 | cson_object_set(pay,"lastSavedBy",json_new_string(pWiki->zUser)); |
| 108 | 108 | cson_object_set(pay,FossilJsonKeys.timestamp, json_julian_to_timestamp(pWiki->rDate)); |
| 109 | 109 | cson_object_set(pay,"contentFormat",json_new_string(zFormat)); |
| 110 | 110 | if( ('h'==*zFormat) ){ |
| 111 | 111 | Blob content = empty_blob; |
| @@ -112,18 +112,18 @@ | ||
| 112 | 112 | Blob raw = empty_blob; |
| 113 | 113 | blob_append(&raw,zBody,-1); |
| 114 | 114 | wiki_convert(&raw,&content,0); |
| 115 | 115 | len = strlen(zBody); |
| 116 | 116 | len = (unsigned int)blob_size(&content); |
| 117 | - cson_object_set(pay,"contentLength",cson_value_new_integer((cson_int_t)len)); | |
| 117 | + cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); | |
| 118 | 118 | cson_object_set(pay,"content", |
| 119 | 119 | cson_value_new_string(blob_buffer(&content),len)); |
| 120 | 120 | blob_reset(&content); |
| 121 | 121 | blob_reset(&raw); |
| 122 | 122 | }else{ |
| 123 | 123 | len = strlen(zBody); |
| 124 | - cson_object_set(pay,"contentLength",cson_value_new_integer((cson_int_t)len)); | |
| 124 | + cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); | |
| 125 | 125 | cson_object_set(pay,"content",cson_value_new_string(zBody,len)); |
| 126 | 126 | } |
| 127 | 127 | /*TODO: add 'T' (tag) fields*/ |
| 128 | 128 | /*TODO: add the 'A' card (file attachment) entries?*/ |
| 129 | 129 | manifest_destroy(pWiki); |
| 130 | 130 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | cson_object * pay = cson_value_get_object(payV); |
| 102 | cson_object_set(pay,"name",json_new_string(zPageName)); |
| 103 | cson_object_set(pay,"uuid",json_new_string(zUuid)); |
| 104 | free(zUuid); |
| 105 | zUuid = NULL; |
| 106 | cson_object_set(pay,"rid",cson_value_new_integer((cson_int_t)rid)); |
| 107 | cson_object_set(pay,"lastSavedBy",json_new_string(pWiki->zUser)); |
| 108 | cson_object_set(pay,FossilJsonKeys.timestamp, json_julian_to_timestamp(pWiki->rDate)); |
| 109 | cson_object_set(pay,"contentFormat",json_new_string(zFormat)); |
| 110 | if( ('h'==*zFormat) ){ |
| 111 | Blob content = empty_blob; |
| @@ -112,18 +112,18 @@ | |
| 112 | Blob raw = empty_blob; |
| 113 | blob_append(&raw,zBody,-1); |
| 114 | wiki_convert(&raw,&content,0); |
| 115 | len = strlen(zBody); |
| 116 | len = (unsigned int)blob_size(&content); |
| 117 | cson_object_set(pay,"contentLength",cson_value_new_integer((cson_int_t)len)); |
| 118 | cson_object_set(pay,"content", |
| 119 | cson_value_new_string(blob_buffer(&content),len)); |
| 120 | blob_reset(&content); |
| 121 | blob_reset(&raw); |
| 122 | }else{ |
| 123 | len = strlen(zBody); |
| 124 | cson_object_set(pay,"contentLength",cson_value_new_integer((cson_int_t)len)); |
| 125 | cson_object_set(pay,"content",cson_value_new_string(zBody,len)); |
| 126 | } |
| 127 | /*TODO: add 'T' (tag) fields*/ |
| 128 | /*TODO: add the 'A' card (file attachment) entries?*/ |
| 129 | manifest_destroy(pWiki); |
| 130 |
| --- src/json_wiki.c | |
| +++ src/json_wiki.c | |
| @@ -101,11 +101,11 @@ | |
| 101 | cson_object * pay = cson_value_get_object(payV); |
| 102 | cson_object_set(pay,"name",json_new_string(zPageName)); |
| 103 | cson_object_set(pay,"uuid",json_new_string(zUuid)); |
| 104 | free(zUuid); |
| 105 | zUuid = NULL; |
| 106 | cson_object_set(pay,"rid",json_new_int((cson_int_t)rid)); |
| 107 | cson_object_set(pay,"lastSavedBy",json_new_string(pWiki->zUser)); |
| 108 | cson_object_set(pay,FossilJsonKeys.timestamp, json_julian_to_timestamp(pWiki->rDate)); |
| 109 | cson_object_set(pay,"contentFormat",json_new_string(zFormat)); |
| 110 | if( ('h'==*zFormat) ){ |
| 111 | Blob content = empty_blob; |
| @@ -112,18 +112,18 @@ | |
| 112 | Blob raw = empty_blob; |
| 113 | blob_append(&raw,zBody,-1); |
| 114 | wiki_convert(&raw,&content,0); |
| 115 | len = strlen(zBody); |
| 116 | len = (unsigned int)blob_size(&content); |
| 117 | cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); |
| 118 | cson_object_set(pay,"content", |
| 119 | cson_value_new_string(blob_buffer(&content),len)); |
| 120 | blob_reset(&content); |
| 121 | blob_reset(&raw); |
| 122 | }else{ |
| 123 | len = strlen(zBody); |
| 124 | cson_object_set(pay,"contentLength",json_new_int((cson_int_t)len)); |
| 125 | cson_object_set(pay,"content",cson_value_new_string(zBody,len)); |
| 126 | } |
| 127 | /*TODO: add 'T' (tag) fields*/ |
| 128 | /*TODO: add the 'A' card (file attachment) entries?*/ |
| 129 | manifest_destroy(pWiki); |
| 130 |