btparser/cparser/tests/exp_lex/CABTemplate.bt

117 lines
1.9 KiB
Plaintext

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15: typedef struct {
16:
17: char signature [ 4 ] ;
18: uint reserved1 ;
19: uint cbCabinet ;
20: uint reserved2 ;
21: uint coffFiles ;
22: uint reserved3 ;
23: ubyte versionMinor ;
24: ubyte versionMajor ;
25: ushort cFolders ;
26: ushort cFiles ;
27: ushort flags ;
28: ushort setID ;
29: ushort iCabinet ;
30:
31: if ( flags & 4 ) {
32:
33: ushort cbCFHeader ;
34: ubyte cbCFFolder ;
35: ubyte cbCFData ;
36:
37: if ( cbCFHeader > 0 )
38: char abReserve [ cbCFHeader ] ;
39:
40: }
41: if ( flags & 1 ) {
42:
43: char szCabinetPrev [ ] ;
44: char szDiskPrev [ ] ;
45:
46: }
47: if ( flags & 2 ) {
48:
49: char szCabinetNext [ ] ;
50: char szDiskNext [ ] ;
51:
52: }
53:
54: } CFHEADER ;
55:
56: LittleEndian ( ) ;
57: CFHEADER header ;
58: local uint counter = 0 ;
59:
60: typedef struct {
61:
62: uint coffCabStart ;
63: ushort cCFData ;
64: ushort typeCompress ;
65:
66: if ( exists ( header . cbCFFolder ) )
67: char abReserve [ header . cbCFFolder ] ;
68:
69: } CFFOLDER ;
70:
71: typedef struct {
72:
73: uint cbFile ;
74: uint uoffFolderStart ;
75: ushort iFolder ;
76: DOSDATE date ;
77: DOSTIME time ;
78: ushort attribs ;
79: char szName [ ] ;
80: } CFFILE ;
81:
82: typedef struct {
83:
84: uint csum ;
85: ushort cbData ;
86: ushort cbUncomp ;
87:
88: if ( exists ( header . cbCFData ) )
89: char abReserve [ header . cbCFData ] ;
90:
91: char ab [ cbData ] ;
92: } CFDATA ;
93:
94: while ( header . cFolders > counter ) {
95:
96: counter ++ ;
97: CFFOLDER folder ;
98:
99: }
100:
101: counter = 0 ;
102:
103: while ( header . cFiles > counter ) {
104:
105: counter ++ ;
106: CFFILE file ;
107:
108: }
109:
110: counter = 0 ;
111:
112: while ( folder . cCFData > counter ) {
113:
114: counter ++ ;
115: CFDATA data ;
116:
117: } tok_eof