summaryrefslogtreecommitdiff
path: root/lib/uefi.c3l/extension/file.c3
diff options
context:
space:
mode:
authorandromeda <andromeda@bsd.my.domain>2026-10-19 18:54:26 -0400
committerandromeda <andromeda@bsd.my.domain>2026-10-19 18:54:26 -0400
commitaa113b17449e67dbd808587b411aeb21ea869974 (patch)
treeb6b7f1b71d761cbc043d5e97f72345d428c140ac /lib/uefi.c3l/extension/file.c3
parent97d331175ae47aec3d0b990ada9754a9e4298e32 (diff)
minimal running stub
Diffstat (limited to 'lib/uefi.c3l/extension/file.c3')
-rw-r--r--lib/uefi.c3l/extension/file.c322
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/uefi.c3l/extension/file.c3 b/lib/uefi.c3l/extension/file.c3
new file mode 100644
index 0000000..1e40e83
--- /dev/null
+++ b/lib/uefi.c3l/extension/file.c3
@@ -0,0 +1,22 @@
+module uefi::protocol::file;
+
+macro FileProtocol.open(&self, FileProtocol** newHandle, WChar* fileName, FileOpenMode openMode, ulong attributes)
+ => self._open(self, newHandle, fileName, openMode, attributes);
+
+macro FileProtocol.close(&self) => self._close(self);
+macro FileProtocol.delete(&self) => self._delete(self);
+macro FileProtocol.read(&self, usz* bufSize, void* buf) => self._read(self, bufSize, buf);
+macro FileProtocol.write(&self, usz* bufSize, void* buf) => self._write(self, bufSize, buf);
+macro FileProtocol.get_position(&self, ulong* pos) => self._get_position(self, pos);
+macro FileProtocol.set_position(&self, ulong pos) => self._set_position(self, pos);
+macro FileProtocol.get_info(&self, EfiGuid* infoType, usz* bufSize, void* buf) => self._get_info(self, infoType, bufSize, buf);
+macro FileProtocol.set_info(&self, EfiGuid* infoType, usz bufSize, void* buf) => self._set_info(self, infoType, bufSize, buf);
+macro FileProtocol.flush(&self) => self._flush(self);
+
+macro FileSystemProtocol.open_volume(&self, FileProtocol** fileProt) => self._open_volume(self, fileProt);
+
+constdef FileOpenMode : inline ulong {
+ CREATE = 0,
+ READ = 1,
+ WRITE = 2,
+}