Expose libappletCreateWriteStorage.

This commit is contained in:
yellows8 2019-02-19 21:46:53 -05:00
parent 1415df75e4
commit d90893c566
2 changed files with 11 additions and 3 deletions

View File

@ -34,6 +34,14 @@ void libappletArgsCreate(LibAppletArgs* a, u32 version);
*/ */
void libappletArgsSetPlayStartupSound(LibAppletArgs* a, bool flag); void libappletArgsSetPlayStartupSound(LibAppletArgs* a, bool flag);
/**
* @brief Creates an AppletStorage with the specified size and writes the buffer contents to that storage at offset 0.
* @param[out] s Storage object.
* @param buffer Input buffer.
* @param size Size to write.
*/
Result libappletCreateWriteStorage(AppletStorage* s, const void* buffer, size_t size);
/** /**
* @brief Reads data from offset 0 from the specified storage into the buffer. If the storage-size is smaller than the size param, the storage-size is used instead. * @brief Reads data from offset 0 from the specified storage into the buffer. If the storage-size is smaller than the size param, the storage-size is used instead.
* @param s Storage object. * @param s Storage object.

View File

@ -19,7 +19,7 @@ void libappletArgsSetPlayStartupSound(LibAppletArgs* a, bool flag) {
a->PlayStartupSound = flag!=0; a->PlayStartupSound = flag!=0;
} }
static Result _libappletCreateWriteStorage(AppletStorage* s, const void* buffer, size_t size) { Result libappletCreateWriteStorage(AppletStorage* s, const void* buffer, size_t size) {
Result rc=0; Result rc=0;
rc = appletCreateStorage(s, size); rc = appletCreateStorage(s, size);
@ -54,7 +54,7 @@ static Result _libappletPushInData(AppletHolder *h, const void* buffer, size_t s
Result rc=0; Result rc=0;
AppletStorage storage; AppletStorage storage;
rc = _libappletCreateWriteStorage(&storage, buffer, size); rc = libappletCreateWriteStorage(&storage, buffer, size);
if (R_FAILED(rc)) return rc; if (R_FAILED(rc)) return rc;
return appletHolderPushInData(h, &storage); return appletHolderPushInData(h, &storage);
@ -73,7 +73,7 @@ static Result _libappletQlaunchRequest(u8* buf, size_t size) {
Result rc=0; Result rc=0;
AppletStorage storage; AppletStorage storage;
rc = _libappletCreateWriteStorage(&storage, buf, size); rc = libappletCreateWriteStorage(&storage, buf, size);
if (R_FAILED(rc)) return rc; if (R_FAILED(rc)) return rc;
return appletPushToGeneralChannel(&storage); return appletPushToGeneralChannel(&storage);