From bf64859f5aa261fa8db7bfdd9af4f67826ff4e5b Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Mon, 14 Apr 2025 01:43:28 -0400 Subject: [SharedCache] Expose cache entry name in the API Allows us to display the user friendly name of the cache entry in the triage view --- view/sharedcache/api/sharedcache.cpp | 2 ++ view/sharedcache/api/sharedcacheapi.h | 1 + view/sharedcache/api/sharedcachecore.h | 1 + 3 files changed, 4 insertions(+) (limited to 'view/sharedcache/api') diff --git a/view/sharedcache/api/sharedcache.cpp b/view/sharedcache/api/sharedcache.cpp index 922a7ff3..d1ec680d 100644 --- a/view/sharedcache/api/sharedcache.cpp +++ b/view/sharedcache/api/sharedcache.cpp @@ -78,6 +78,7 @@ BNSharedCacheEntry EntryToApi(const CacheEntry &entry) { BNSharedCacheEntry apiEntry {}; apiEntry.path = BNAllocString(entry.path.c_str()); + apiEntry.name = BNAllocString(entry.name.c_str()); apiEntry.entryType = entry.entryType; const auto &mappings = entry.mappings; apiEntry.mappingCount = mappings.size(); @@ -92,6 +93,7 @@ CacheEntry EntryFromApi(BNSharedCacheEntry apiEntry) { CacheEntry entry {}; entry.path = apiEntry.path; + entry.name = apiEntry.name; entry.entryType = apiEntry.entryType; entry.mappings.reserve(apiEntry.mappingCount); for (size_t i = 0; i < apiEntry.mappingCount; i++) diff --git a/view/sharedcache/api/sharedcacheapi.h b/view/sharedcache/api/sharedcacheapi.h index 5a842cba..097c185b 100644 --- a/view/sharedcache/api/sharedcacheapi.h +++ b/view/sharedcache/api/sharedcacheapi.h @@ -278,6 +278,7 @@ namespace SharedCacheAPI { struct CacheEntry { std::string path; + std::string name; BNSharedCacheEntryType entryType; std::vector mappings; }; diff --git a/view/sharedcache/api/sharedcachecore.h b/view/sharedcache/api/sharedcachecore.h index ab2acb60..00b24b60 100644 --- a/view/sharedcache/api/sharedcachecore.h +++ b/view/sharedcache/api/sharedcachecore.h @@ -97,6 +97,7 @@ extern "C" typedef struct BNSharedCacheEntry { char* path; + char* name; BNSharedCacheEntryType entryType; size_t mappingCount; BNSharedCacheMappingInfo* mappings; -- cgit v1.3.1