| | @@ -80,11 +80,11 @@ |
| 80 | 80 | ** the page. |
| 81 | 81 | ** |
| 82 | 82 | ** The returned value, if not NULL, is-a JSON Object owned by the |
| 83 | 83 | ** caller. If it returns NULL then it may set g.json's error state. |
| 84 | 84 | */ |
| 85 | | -cson_value * json_get_wiki_page_by_rid(int rid, char contentFormat){ |
| 85 | +cson_value * json_get_wiki_page_by_rid(int rid, int contentFormat){ |
| 86 | 86 | Manifest * pWiki = NULL; |
| 87 | 87 | if( NULL == (pWiki = manifest_get(rid, CFTYPE_WIKI, 0)) ){ |
| 88 | 88 | json_set_err( FSL_JSON_E_UNKNOWN, |
| 89 | 89 | "Error reading wiki page from manifest (rid=%d).", |
| 90 | 90 | rid ); |
| | @@ -145,11 +145,11 @@ |
| 145 | 145 | /* |
| 146 | 146 | ** Searches for the latest version of a wiki page with the given |
| 147 | 147 | ** name. If found it behaves like json_get_wiki_page_by_rid(theRid, |
| 148 | 148 | ** contentFormat), else it returns NULL. |
| 149 | 149 | */ |
| 150 | | -cson_value * json_get_wiki_page_by_name(char const * zPageName, char contentFormat){ |
| 150 | +cson_value * json_get_wiki_page_by_name(char const * zPageName, int contentFormat){ |
| 151 | 151 | int rid; |
| 152 | 152 | rid = db_int(0, |
| 153 | 153 | "SELECT x.rid FROM tag t, tagxref x, blob b" |
| 154 | 154 | " WHERE x.tagid=t.tagid AND t.tagname='wiki-%q' " |
| 155 | 155 | " AND b.rid=x.rid" |
| | @@ -175,12 +175,12 @@ |
| 175 | 175 | ** [r]aw = -1 |
| 176 | 176 | ** |
| 177 | 177 | ** The return value is intended for use with |
| 178 | 178 | ** json_get_wiki_page_by_rid() and friends. |
| 179 | 179 | */ |
| 180 | | -char json_wiki_get_content_format_flag( char defaultValue ){ |
| 181 | | - char contentFormat = defaultValue; |
| 180 | +int json_wiki_get_content_format_flag( int defaultValue ){ |
| 181 | + int contentFormat = defaultValue; |
| 182 | 182 | char const * zFormat = json_find_option_cstr("format",NULL,"f"); |
| 183 | 183 | if( !zFormat || !*zFormat ){ |
| 184 | 184 | return contentFormat; |
| 185 | 185 | } |
| 186 | 186 | else if('r'==*zFormat){ |
| | @@ -203,11 +203,11 @@ |
| 203 | 203 | ** json_get_wiki_page_by_name() will be returned (owned by the |
| 204 | 204 | ** caller). On error g.json's error state is set and NULL is returned. |
| 205 | 205 | */ |
| 206 | 206 | static cson_value * json_wiki_get_by_name_or_symname(char const * zPageName, |
| 207 | 207 | char const * zSymname, |
| 208 | | - char contentFormat ){ |
| 208 | + int contentFormat ){ |
| 209 | 209 | if(!zSymname || !*zSymname){ |
| 210 | 210 | return json_get_wiki_page_by_name(zPageName, contentFormat); |
| 211 | 211 | }else{ |
| 212 | 212 | int rid = symbolic_name_to_rid( zSymname ? zSymname : zPageName, "w" ); |
| 213 | 213 | if(rid<0){ |
| | @@ -229,11 +229,11 @@ |
| 229 | 229 | ** |
| 230 | 230 | */ |
| 231 | 231 | static cson_value * json_wiki_get(){ |
| 232 | 232 | char const * zPageName; |
| 233 | 233 | char const * zSymName = NULL; |
| 234 | | - char contentFormat = -1; |
| 234 | + int contentFormat = -1; |
| 235 | 235 | if( !g.perm.RdWiki && !g.perm.Read ){ |
| 236 | 236 | json_set_err(FSL_JSON_E_DENIED, |
| 237 | 237 | "Requires 'o' or 'j' access."); |
| 238 | 238 | return NULL; |
| 239 | 239 | } |
| | @@ -373,11 +373,11 @@ |
| 373 | 373 | contentLen = (int)cson_string_length_bytes(jstr); |
| 374 | 374 | if(contentLen){ |
| 375 | 375 | blob_append(&content, cson_string_cstr(jstr),contentLen); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | | - zMimeType = json_find_option_cstr("format","format","F"); |
| 378 | + zMimeType = json_find_option_cstr("mimetype","mimetype","M"); |
| 379 | 379 | |
| 380 | 380 | wiki_cmd_commit(zPageName, 0==rid, &content, zMimeType); |
| 381 | 381 | blob_reset(&content); |
| 382 | 382 | /* |
| 383 | 383 | Our return value here has a race condition: if this operation |
| 384 | 384 | |