1919import Foundation
2020
2121extension EXT4 {
22- struct SuperBlock {
23- var inodesCount : UInt32 = 0
24- var blocksCountLow : UInt32 = 0
25- var rootBlocksCountLow : UInt32 = 0
26- var freeBlocksCountLow : UInt32 = 0
27- var freeInodesCount : UInt32 = 0
28- var firstDataBlock : UInt32 = 0
29- var logBlockSize : UInt32 = 0
30- var logClusterSize : UInt32 = 0
31- var blocksPerGroup : UInt32 = 0
32- var clustersPerGroup : UInt32 = 0
33- var inodesPerGroup : UInt32 = 0
34- var mtime : UInt32 = 0
35- var wtime : UInt32 = 0
36- var mountCount : UInt16 = 0
37- var maxMountCount : UInt16 = 0
38- var magic : UInt16 = 0
39- var state : UInt16 = 0
40- var errors : UInt16 = 0
41- var minorRevisionLevel : UInt16 = 0
42- var lastCheck : UInt32 = 0
43- var checkInterval : UInt32 = 0
44- var creatorOS : UInt32 = 0
45- var revisionLevel : UInt32 = 0
46- var defaultReservedUid : UInt16 = 0
47- var defaultReservedGid : UInt16 = 0
48- var firstInode : UInt32 = 0
49- var inodeSize : UInt16 = 0
50- var blockGroupNr : UInt16 = 0
51- var featureCompat : UInt32 = 0
52- var featureIncompat : UInt32 = 0
53- var featureRoCompat : UInt32 = 0
54- var uuid :
22+ public struct SuperBlock {
23+ public var inodesCount : UInt32 = 0
24+ public var blocksCountLow : UInt32 = 0
25+ public var rootBlocksCountLow : UInt32 = 0
26+ public var freeBlocksCountLow : UInt32 = 0
27+ public var freeInodesCount : UInt32 = 0
28+ public var firstDataBlock : UInt32 = 0
29+ public var logBlockSize : UInt32 = 0
30+ public var logClusterSize : UInt32 = 0
31+ public var blocksPerGroup : UInt32 = 0
32+ public var clustersPerGroup : UInt32 = 0
33+ public var inodesPerGroup : UInt32 = 0
34+ public var mtime : UInt32 = 0
35+ public var wtime : UInt32 = 0
36+ public var mountCount : UInt16 = 0
37+ public var maxMountCount : UInt16 = 0
38+ public var magic : UInt16 = 0
39+ public var state : UInt16 = 0
40+ public var errors : UInt16 = 0
41+ public var minorRevisionLevel : UInt16 = 0
42+ public var lastCheck : UInt32 = 0
43+ public var checkInterval : UInt32 = 0
44+ public var creatorOS : UInt32 = 0
45+ public var revisionLevel : UInt32 = 0
46+ public var defaultReservedUid : UInt16 = 0
47+ public var defaultReservedGid : UInt16 = 0
48+ public var firstInode : UInt32 = 0
49+ public var inodeSize : UInt16 = 0
50+ public var blockGroupNr : UInt16 = 0
51+ public var featureCompat : UInt32 = 0
52+ public var featureIncompat : UInt32 = 0
53+ public var featureRoCompat : UInt32 = 0
54+ public var uuid :
5555 (
5656 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
5757 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8
5858 ) = (
5959 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
6060 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
6161 )
62- var volumeName :
62+ public var volumeName :
6363 (
6464 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
6565 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8
6666 ) = (
6767 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
6868 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
6969 )
70- var lastMounted :
70+ public var lastMounted :
7171 (
7272 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
7373 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
@@ -87,29 +87,29 @@ extension EXT4 {
8787 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
8888 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
8989 )
90- var algorithmUsageBitmap : UInt32 = 0
91- var preallocBlocks : UInt8 = 0
92- var preallocDirBlocks : UInt8 = 0
93- var reservedGdtBlocks : UInt16 = 0
94- var journalUUID :
90+ public var algorithmUsageBitmap : UInt32 = 0
91+ public var preallocBlocks : UInt8 = 0
92+ public var preallocDirBlocks : UInt8 = 0
93+ public var reservedGdtBlocks : UInt16 = 0
94+ public var journalUUID :
9595 (
9696 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
9797 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8
9898 ) = (
9999 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
100100 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
101101 )
102- var journalInum : UInt32 = 0
103- var journalDev : UInt32 = 0
104- var lastOrphan : UInt32 = 0
105- var hashSeed : ( UInt32 , UInt32 , UInt32 , UInt32 ) = ( 0 , 0 , 0 , 0 )
106- var defHashVersion : UInt8 = 0
107- var journalBackupType : UInt8 = 0
108- var descSize : UInt16 = UInt16 ( MemoryLayout< GroupDescriptor> . size)
109- var defaultMountOpts : UInt32 = 0
110- var firstMetaBg : UInt32 = 0
111- var mkfsTime : UInt32 = 0
112- var journalBlocks :
102+ public var journalInum : UInt32 = 0
103+ public var journalDev : UInt32 = 0
104+ public var lastOrphan : UInt32 = 0
105+ public var hashSeed : ( UInt32 , UInt32 , UInt32 , UInt32 ) = ( 0 , 0 , 0 , 0 )
106+ public var defHashVersion : UInt8 = 0
107+ public var journalBackupType : UInt8 = 0
108+ public var descSize : UInt16 = UInt16 ( MemoryLayout< GroupDescriptor> . size)
109+ public var defaultMountOpts : UInt32 = 0
110+ public var firstMetaBg : UInt32 = 0
111+ public var mkfsTime : UInt32 = 0
112+ public var journalBlocks :
113113 (
114114 UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 ,
115115 UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 ,
@@ -119,29 +119,29 @@ extension EXT4 {
119119 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
120120 0
121121 )
122- var blocksCountHigh : UInt32 = 0
123- var rBlocksCountHigh : UInt32 = 0
124- var freeBlocksCountHigh : UInt32 = 0
125- var minExtraIsize : UInt16 = 0
126- var wantExtraIsize : UInt16 = 0
127- var flags : UInt32 = 0
128- var raidStride : UInt16 = 0
129- var mmpInterval : UInt16 = 0
130- var mmpBlock : UInt64 = 0
131- var raidStripeWidth : UInt32 = 0
132- var logGroupsPerFlex : UInt8 = 0
133- var checksumType : UInt8 = 0
134- var reservedPad : UInt16 = 0
135- var kbytesWritten : UInt64 = 0
136- var snapshotInum : UInt32 = 0
137- var snapshotID : UInt32 = 0
138- var snapshotRBlocksCount : UInt64 = 0
139- var snapshotList : UInt32 = 0
140- var errorCount : UInt32 = 0
141- var firstErrorTime : UInt32 = 0
142- var firstErrorInode : UInt32 = 0
143- var firstErrorBlock : UInt64 = 0
144- var firstErrorFunc :
122+ public var blocksCountHigh : UInt32 = 0
123+ public var rBlocksCountHigh : UInt32 = 0
124+ public var freeBlocksCountHigh : UInt32 = 0
125+ public var minExtraIsize : UInt16 = 0
126+ public var wantExtraIsize : UInt16 = 0
127+ public var flags : UInt32 = 0
128+ public var raidStride : UInt16 = 0
129+ public var mmpInterval : UInt16 = 0
130+ public var mmpBlock : UInt64 = 0
131+ public var raidStripeWidth : UInt32 = 0
132+ public var logGroupsPerFlex : UInt8 = 0
133+ public var checksumType : UInt8 = 0
134+ public var reservedPad : UInt16 = 0
135+ public var kbytesWritten : UInt64 = 0
136+ public var snapshotInum : UInt32 = 0
137+ public var snapshotID : UInt32 = 0
138+ public var snapshotRBlocksCount : UInt64 = 0
139+ public var snapshotList : UInt32 = 0
140+ public var errorCount : UInt32 = 0
141+ public var firstErrorTime : UInt32 = 0
142+ public var firstErrorInode : UInt32 = 0
143+ public var firstErrorBlock : UInt64 = 0
144+ public var firstErrorFunc :
145145 (
146146 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
147147 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
@@ -153,12 +153,12 @@ extension EXT4 {
153153 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
154154 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
155155 )
156- var firstErrorLine : UInt32 = 0
157- var lastErrorTime : UInt32 = 0
158- var lastErrorInode : UInt32 = 0
159- var lastErrorLine : UInt32 = 0
160- var lastErrorBlock : UInt64 = 0
161- var lastErrorFunc :
156+ public var firstErrorLine : UInt32 = 0
157+ public var lastErrorTime : UInt32 = 0
158+ public var lastErrorInode : UInt32 = 0
159+ public var lastErrorLine : UInt32 = 0
160+ public var lastErrorBlock : UInt64 = 0
161+ public var lastErrorFunc :
162162 (
163163 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
164164 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
@@ -170,7 +170,7 @@ extension EXT4 {
170170 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
171171 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
172172 )
173- var mountOpts :
173+ public var mountOpts :
174174 (
175175 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
176176 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
@@ -190,30 +190,30 @@ extension EXT4 {
190190 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
191191 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
192192 )
193- var userQuotaInum : UInt32 = 0
194- var groupQuotaInum : UInt32 = 0
195- var overheadBlocks : UInt32 = 0
196- var backupBgs : ( UInt32 , UInt32 ) = ( 0 , 0 )
197- var encryptAlgos : ( UInt8 , UInt8 , UInt8 , UInt8 ) = ( 0 , 0 , 0 , 0 )
198- var encryptPwSalt :
193+ public var userQuotaInum : UInt32 = 0
194+ public var groupQuotaInum : UInt32 = 0
195+ public var overheadBlocks : UInt32 = 0
196+ public var backupBgs : ( UInt32 , UInt32 ) = ( 0 , 0 )
197+ public var encryptAlgos : ( UInt8 , UInt8 , UInt8 , UInt8 ) = ( 0 , 0 , 0 , 0 )
198+ public var encryptPwSalt :
199199 (
200200 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 ,
201201 UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8 , UInt8
202202 ) = (
203203 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
204204 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
205205 )
206- var lpfInode : UInt32 = 0
207- var projectQuotaInum : UInt32 = 0
208- var checksumSeed : UInt32 = 0
209- var wtimeHigh : UInt8 = 0
210- var mtimeHigh : UInt8 = 0
211- var mkfsTimeHigh : UInt8 = 0
212- var lastcheckHigh : UInt8 = 0
213- var firstErrorTimeHigh : UInt8 = 0
214- var lastErrorTimeHigh : UInt8 = 0
215- var pad : ( UInt8 , UInt8 ) = ( 0 , 0 )
216- var reserved :
206+ public var lpfInode : UInt32 = 0
207+ public var projectQuotaInum : UInt32 = 0
208+ public var checksumSeed : UInt32 = 0
209+ public var wtimeHigh : UInt8 = 0
210+ public var mtimeHigh : UInt8 = 0
211+ public var mkfsTimeHigh : UInt8 = 0
212+ public var lastcheckHigh : UInt8 = 0
213+ public var firstErrorTimeHigh : UInt8 = 0
214+ public var lastErrorTimeHigh : UInt8 = 0
215+ public var pad : ( UInt8 , UInt8 ) = ( 0 , 0 )
216+ public var reserved :
217217 (
218218 UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 ,
219219 UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 , UInt32 ,
@@ -241,7 +241,7 @@ extension EXT4 {
241241 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
242242 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
243243 )
244- var checksum : UInt32 = 0
244+ public var checksum : UInt32 = 0
245245 }
246246
247247 struct CompatFeature {
@@ -436,6 +436,7 @@ extension EXT4 {
436436 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
437437 0 , 0 , 0 , 0 , 0 , 0
438438 )
439+
439440 public static func Mode( _ mode: FileModeFlag , _ perm: UInt16 ) -> UInt16 {
440441 mode. rawValue | perm
441442 }
0 commit comments