Support passing NULL for webConfigShow out. Minor docs adjustment.

This commit is contained in:
yellows8 2019-03-06 23:46:46 -05:00
parent 9e52d7c4df
commit 4160622165
2 changed files with 15 additions and 13 deletions

View File

@ -217,8 +217,8 @@ Result webPageCreate(WebCommonConfig* config, const char* url);
/**
* @brief Creates the config for WebApplet. This is based on \ref webPageCreate, for News. Hence other functions referencing \ref webPageCreate also apply to this.
* @note Sets ::WebArgType_UnknownD to value 1, and sets ::WebArgType_NewsFlag to true. Also uses \ref webConfigSetEcClientCert and \ref webConfigSetShopJump with flag=true.
* @note The domain from the input URL is automatically whitelisted, in addition to any already loaded whitelist.
* @note Sets ::WebArgType_UnknownD to value 1, and sets ::WebArgType_NewsFlag to true. Also uses \ref webConfigSetEcClientCert and \ref webConfigSetShopJump with flag=true.
* @param config WebCommonConfig object.
* @param url Initial URL navigated to by the applet.
*/

View File

@ -593,20 +593,22 @@ Result webConfigSetPageScrollIndicator(WebCommonConfig* config, bool flag) {
}
Result webConfigShow(WebCommonConfig* config, WebCommonReply *out) {
void* reply;
size_t size;
void* reply = NULL;
size_t size = 0;
// ShareApplet on [3.0.0+] uses TLV storage for the reply, while older versions + everything else uses *ReturnValue.
memset(out, 0, sizeof(*out));
if (config->version >= 0x30000 && _webGetShimKind(config) == WebShimKind_Share) out->type = true;
if (out) {
// ShareApplet on [3.0.0+] uses TLV storage for the reply, while older versions + everything else uses *ReturnValue.
memset(out, 0, sizeof(*out));
if (config->version >= 0x30000 && _webGetShimKind(config) == WebShimKind_Share) out->type = true;
if (!out->type) {
reply = &out->ret;
size = sizeof(out->ret);
}
else {
reply = &out->storage;
size = sizeof(out->storage);
if (!out->type) {
reply = &out->ret;
size = sizeof(out->ret);
}
else {
reply = &out->storage;
size = sizeof(out->storage);
}
}
return _webShow(&config->holder, config->appletid, config->version, &config->arg, sizeof(config->arg), reply, size);