mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[external] First attempt to merge Khi external API
This commit is contained in:
6
apps/external/archive.cpp
vendored
6
apps/external/archive.cpp
vendored
@@ -74,6 +74,8 @@ bool fileAtIndex(size_t index, File &entry) {
|
||||
entry.data = reinterpret_cast<const uint8_t*>(tar) + sizeof(TarHeader);
|
||||
entry.dataLength = size;
|
||||
entry.isExecutable = (tar->mode[4] & 0x01) == 1;
|
||||
// TODO: Handle the trash
|
||||
entry.readable = true;
|
||||
|
||||
return true;
|
||||
} else {
|
||||
@@ -115,7 +117,7 @@ int indexFromName(const char *name) {
|
||||
File entry;
|
||||
|
||||
for (int i = 0; fileAtIndex(i, entry); i++) {
|
||||
if (strcmp(name, entry.name) == 0) {
|
||||
if (entry.readable && strcmp(name, entry.name) == 0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
@@ -144,6 +146,7 @@ bool executableAtIndex(size_t index, File &entry) {
|
||||
entry.data = dummy.data;
|
||||
entry.dataLength = dummy.dataLength;
|
||||
entry.isExecutable = dummy.isExecutable;
|
||||
entry.readable = dummy.readable;
|
||||
return true;
|
||||
}
|
||||
final_count++;
|
||||
@@ -177,6 +180,7 @@ bool fileAtIndex(size_t index, File &entry) {
|
||||
entry.data = NULL;
|
||||
entry.dataLength = 0;
|
||||
entry.isExecutable = true;
|
||||
entry.readable = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user