mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 12:34:47 +00:00
ncm: minor fixes
This commit is contained in:
parent
f4af4f8be0
commit
e96c84f1f0
9 changed files with 13 additions and 14 deletions
|
@ -236,7 +236,7 @@ namespace ams::kvdb {
|
|||
static Result CreateNewCache(const char *dir) {
|
||||
/* Make a new key value store filesystem, and a new lru_list.dat. */
|
||||
R_TRY(LeastRecentlyUsedList::CreateNewList(GetLeastRecentlyUsedListPath(dir)));
|
||||
R_UNLESS(mkdir(GetFileKeyValueStorePath(dir), 0) == 0, fsdevGetLastResult());
|
||||
R_TRY(fs::CreateDirectory(dir));
|
||||
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace ams::ncm {
|
|||
u16 extended_header_size;
|
||||
u16 content_count;
|
||||
u16 content_meta_count;
|
||||
ContentMetaAttribute attributes;
|
||||
u8 attributes;
|
||||
StorageId storage_id;
|
||||
};
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace ams::ncm {
|
|||
return lc;
|
||||
}
|
||||
|
||||
ListCount ListContentMeta(ContentMetaKey *dst, size_t dst_size, ContentMetaType type, ProgramId app_id, ProgramId min, ProgramId max, ContentInstallType install_type) {
|
||||
ListCount ListContentMeta(ContentMetaKey *dst, size_t dst_size, ContentMetaType type, ProgramId app_id = InvalidProgramId, ProgramId min = {std::numeric_limits<u64>::min()}, ProgramId max = {std::numeric_limits<u64>::max()}, ContentInstallType install_type = ContentInstallType::Full) {
|
||||
ListCount lc = {};
|
||||
R_ABORT_UNLESS(this->interface->List(std::addressof(lc.total), std::addressof(lc.written), sf::OutArray<ContentMetaKey>(dst, dst_size), type, app_id, min, max, install_type));
|
||||
return lc;
|
||||
|
@ -173,7 +173,7 @@ namespace ams::ncm {
|
|||
return this->interface->Commit();
|
||||
}
|
||||
|
||||
Result GetAttributes(ContentMetaAttribute *out_attributes, const ContentMetaKey &key) {
|
||||
Result GetAttributes(u8 *out_attributes, const ContentMetaKey &key) {
|
||||
AMS_ASSERT(this->interface != nullptr);
|
||||
return this->interface->GetAttributes(out_attributes, key);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace ams::ncm {
|
|||
virtual Result Commit() = 0;
|
||||
virtual Result HasContent(sf::Out<bool> out, const ContentMetaKey &key, const ContentId &content_id) = 0;
|
||||
virtual Result ListContentMetaInfo(sf::Out<u32> out_entries_written, const sf::OutArray<ContentMetaInfo> &out_meta_info, const ContentMetaKey &key, u32 start_index) = 0;
|
||||
virtual Result GetAttributes(sf::Out<ContentMetaAttribute> out_attributes, const ContentMetaKey &key) = 0;
|
||||
virtual Result GetAttributes(sf::Out<u8> out_attributes, const ContentMetaKey &key) = 0;
|
||||
virtual Result GetRequiredApplicationVersion(sf::Out<u32> out_version, const ContentMetaKey &key) = 0;
|
||||
virtual Result GetContentIdByTypeAndIdOffset(sf::Out<ContentId> out_content_id, const ContentMetaKey &key, ContentType type, u8 id_offset) = 0;
|
||||
public:
|
||||
|
|
|
@ -43,10 +43,10 @@ namespace ams::ncm {
|
|||
DeltaFragment = 6,
|
||||
};
|
||||
|
||||
enum class ContentMetaAttribute : u8 {
|
||||
None = 0,
|
||||
IncludesExFatDriver = 1,
|
||||
Rebootless = 2,
|
||||
enum ContentMetaAttribute : u8 {
|
||||
ContentMetaAttribute_None = (0 << 0),
|
||||
ContentMetaAttribute_IncludesExFatDriver = (1 << 0),
|
||||
ContentMetaAttribute_Rebootless = (1 << 1),
|
||||
};
|
||||
|
||||
enum class ContentInstallType : u8 {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <dirent.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
namespace ams::boot2 {
|
||||
|
|
|
@ -144,9 +144,9 @@ namespace ams::ncm {
|
|||
return ncmContentMetaDatabaseListContentMetaInfo(std::addressof(this->srv), reinterpret_cast<s32 *>(out_entries_written.GetPointer()), out_meta_info.GetPointer(), out_meta_info.GetSize(), Convert(key), start_index);
|
||||
}
|
||||
|
||||
virtual Result GetAttributes(sf::Out<ContentMetaAttribute> out_attributes, const ContentMetaKey &key) override {
|
||||
virtual Result GetAttributes(sf::Out<u8> out_attributes, const ContentMetaKey &key) override {
|
||||
static_assert(sizeof(ContentMetaAttribute) == sizeof(u8));
|
||||
return ncmContentMetaDatabaseGetAttributes(std::addressof(this->srv), Convert(key), reinterpret_cast<u8 *>(out_attributes.GetPointer()));
|
||||
return ncmContentMetaDatabaseGetAttributes(std::addressof(this->srv), Convert(key), out_attributes.GetPointer());
|
||||
}
|
||||
|
||||
virtual Result GetRequiredApplicationVersion(sf::Out<u32> out_version, const ContentMetaKey &key) override {
|
||||
|
|
|
@ -333,7 +333,7 @@ namespace ams::ncm {
|
|||
return ResultSuccess();
|
||||
}
|
||||
|
||||
Result ContentMetaDatabaseImpl::GetAttributes(sf::Out<ContentMetaAttribute> out_attributes, const ContentMetaKey &key) {
|
||||
Result ContentMetaDatabaseImpl::GetAttributes(sf::Out<u8> out_attributes, const ContentMetaKey &key) {
|
||||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
const void *meta;
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace ams::ncm {
|
|||
virtual Result Commit() override;
|
||||
virtual Result HasContent(sf::Out<bool> out, const ContentMetaKey &key, const ContentId &content_id) override;
|
||||
virtual Result ListContentMetaInfo(sf::Out<u32> out_entries_written, const sf::OutArray<ContentMetaInfo> &out_meta_info, const ContentMetaKey &key, u32 start_index) override;
|
||||
virtual Result GetAttributes(sf::Out<ContentMetaAttribute> out_attributes, const ContentMetaKey &key) override;
|
||||
virtual Result GetAttributes(sf::Out<u8> out_attributes, const ContentMetaKey &key) override;
|
||||
virtual Result GetRequiredApplicationVersion(sf::Out<u32> out_version, const ContentMetaKey &key) override;
|
||||
virtual Result GetContentIdByTypeAndIdOffset(sf::Out<ContentId> out_content_id, const ContentMetaKey &key, ContentType type, u8 id_offset) override;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue