| ... | @@ -16,7 +16,7 @@ pub const FileProtocol = extern struct { | ... | @@ -16,7 +16,7 @@ pub const FileProtocol = extern struct { |
| 16 | _read: fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status, | 16 | _read: fn (*const FileProtocol, *usize, [*]u8) callconv(.C) Status, |
| 17 | _write: fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status, | 17 | _write: fn (*const FileProtocol, *usize, [*]const u8) callconv(.C) Status, |
| 18 | _get_position: fn (*const FileProtocol, *u64) callconv(.C) Status, | 18 | _get_position: fn (*const FileProtocol, *u64) callconv(.C) Status, |
| 19 | _set_position: fn (*const FileProtocol, *const u64) callconv(.C) Status, | 19 | _set_position: fn (*const FileProtocol, u64) callconv(.C) Status, |
| 20 | _get_info: fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) callconv(.C) Status, | 20 | _get_info: fn (*const FileProtocol, *align(8) const Guid, *const usize, [*]u8) callconv(.C) Status, |
| 21 | _set_info: fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status, | 21 | _set_info: fn (*const FileProtocol, *align(8) const Guid, usize, [*]const u8) callconv(.C) Status, |
| 22 | _flush: fn (*const FileProtocol) callconv(.C) Status, | 22 | _flush: fn (*const FileProtocol) callconv(.C) Status, |
| ... | @@ -41,11 +41,19 @@ pub const FileProtocol = extern struct { | ... | @@ -41,11 +41,19 @@ pub const FileProtocol = extern struct { |
| 41 | return self._write(self, buffer_size, buffer); | 41 | return self._write(self, buffer_size, buffer); |
| 42 | } | 42 | } |
| 43 | | 43 | |
| 44 | pub fn get_info(self: *const FileProtocol, information_type: *align(8) Guid, buffer_size: *usize, buffer: [*]u8) Status { | 44 | pub fn getPosition(self: *const FileProtocol, position: *u64) Status { |
| | 45 | return self._get_position(self, position); |
| | 46 | } |
| | 47 | |
| | 48 | pub fn setPosition(self: *const FileProtocol, position: u64) Status { |
| | 49 | return self._set_position(self, position); |
| | 50 | } |
| | 51 | |
| | 52 | pub fn getInfo(self: *const FileProtocol, information_type: *align(8) Guid, buffer_size: *usize, buffer: [*]u8) Status { |
| 45 | return self._get_info(self, information_type, buffer_size, buffer); | 53 | return self._get_info(self, information_type, buffer_size, buffer); |
| 46 | } | 54 | } |
| 47 | | 55 | |
| 48 | pub fn set_info(self: *const FileProtocol, information_type: *align(8) Guid, buffer_size: usize, buffer: [*]const u8) Status { | 56 | pub fn setInfo(self: *const FileProtocol, information_type: *align(8) Guid, buffer_size: usize, buffer: [*]const u8) Status { |
| 49 | return self._set_info(self, information_type, buffer_size, buffer); | 57 | return self._set_info(self, information_type, buffer_size, buffer); |
| 50 | } | 58 | } |
| 51 | | 59 | |
| ... | @@ -73,6 +81,8 @@ pub const FileProtocol = extern struct { | ... | @@ -73,6 +81,8 @@ pub const FileProtocol = extern struct { |
| 73 | pub const efi_file_directory: u64 = 0x0000000000000010; | 81 | pub const efi_file_directory: u64 = 0x0000000000000010; |
| 74 | pub const efi_file_archive: u64 = 0x0000000000000020; | 82 | pub const efi_file_archive: u64 = 0x0000000000000020; |
| 75 | pub const efi_file_valid_attr: u64 = 0x0000000000000037; | 83 | pub const efi_file_valid_attr: u64 = 0x0000000000000037; |
| | 84 | |
| | 85 | pub const efi_file_position_end_of_file: u64 = 0xffffffffffffffff; |
| 76 | }; | 86 | }; |
| 77 | | 87 | |
| 78 | pub const FileInfo = extern struct { | 88 | pub const FileInfo = extern struct { |