feat: expose drive labels to userspace, render in Files
This commit is contained in:
@@ -1748,6 +1748,14 @@ namespace Fs::Fat32 {
|
||||
// Template thunks — generate unique function pointers per instance
|
||||
// =========================================================================
|
||||
|
||||
static const char* GetLabelImpl(int inst) {
|
||||
if (inst < 0 || inst >= g_instanceCount || !g_instances[inst].active) return nullptr;
|
||||
|
||||
const char* label = g_instances[inst].volumeLabel;
|
||||
if (label[0] == '\0' || StrEqualNoCase(label, "NO NAME")) return nullptr;
|
||||
return label;
|
||||
}
|
||||
|
||||
template<int N> struct Thunks {
|
||||
static int Open(const char* p) { return OpenImpl(N, p); }
|
||||
static int Read(int h, uint8_t* b, uint64_t o, uint64_t s) { return ReadImpl(N, h, b, o, s); }
|
||||
@@ -1759,6 +1767,7 @@ namespace Fs::Fat32 {
|
||||
static int Delete(const char* p) { return DeleteImpl(N, p); }
|
||||
static int Mkdir(const char* p) { return MkdirImpl(N, p); }
|
||||
static int Rename(const char* o, const char* n) { return RenameImpl(N, o, n); }
|
||||
static const char* GetLabel() { return GetLabelImpl(N); }
|
||||
};
|
||||
|
||||
template<int N>
|
||||
@@ -1774,6 +1783,7 @@ namespace Fs::Fat32 {
|
||||
Thunks<N>::Delete,
|
||||
Thunks<N>::Mkdir,
|
||||
Thunks<N>::Rename,
|
||||
Thunks<N>::GetLabel,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user