bump product version to 5.0.4.1
[LibreOffice.git] / basic / source / inc / filefmt.hxx
blobc9d6ba7c8f9565d7c8dd1b360437f6d0780a75b4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_BASIC_SOURCE_INC_FILEFMT_HXX
21 #define INCLUDED_BASIC_SOURCE_INC_FILEFMT_HXX
23 class SvStream;
25 // Version 2: data type of the return value for publics
26 // Version 3: new opcodes
27 // Version 4: new opcodes
28 // Version 5: bug (entry of STATIC-variables in the init code)
29 // Version 6: new opcodes and bug (construct globals, without ending the BASIC)
30 // Version 7: correction concerning the WITH-Parsing
31 // Version 8: correction concerning the IF-Parsing
32 // Version 9: end init code with LEAVE, too, if no SUB/FUNCTION follows
33 // Version A: #36374 at DIM AS NEW... construct variable too
34 // Version B: #40689 reorganized static
35 // Version C: #41606 bug at static
36 // Version D: #42678 bug at RTL-function spc
37 // Version E: #56204 DCREATE, to also construct arrays at DIM AS NEW
38 // Version F: #57844 introduction of SvNumberformat::StringToDouble
39 // Version 10: #29955 generate for-loop-level in Statement-PCodes
40 // Version 11: #29955 force anew compilation because of build-inconsistences
41 // Version 12: aoo#64377 increase code size that basic can handle
42 // tdf#75973 support user defined types B_USERTYPES in password protected macros
43 // Version 13: tdf#94617 store methods nStart information greater than sal_Int16 limit
46 #define B_LEGACYVERSION 0x00000011L
47 #define B_EXT_IMG_VERSION 0x00000012L
48 #define B_CURVERSION 0x00000013L
50 // The file contains either a module- or a library-record.
51 // Those records contain further records. Every record's got
52 // the following header:
54 // sal_uInt16 identifier
55 // sal_uInt32 the record's length without the header
56 // sal_uInt16 number of sub-elements
58 // all the file-offsets in records are relative to the module's start!
60 #define B_LIBRARY 0x4C42 // BL Library Record
61 #define B_MODULE 0x4D42 // BM Module Record
62 #define B_NAME 0x4E4D // MN module name
63 #define B_COMMENT 0x434D // MC comment
64 #define B_SOURCE 0x4353 // SC source code
65 #define B_PCODE 0x4350 // PC p-code
66 #define B_OLDPUBLICS 0x7550 // Pu publics
67 #define B_PUBLICS 0x5550 // PU publics
68 #define B_POOLDIR 0x4450 // PD symbol pool directory
69 #define B_SYMPOOL 0x5953 // SY symbol pool
70 #define B_STRINGPOOL 0x5453 // ST symbol pool
71 #define B_LINERANGES 0x524C // LR line ranges for publics
72 #define B_MODEND 0x454D // ME module end
73 #define B_SBXOBJECTS 0x5853 // SX SBX objects
74 #define B_EXTSOURCE 0x5345 // ES extended source
76 #define B_USERTYPES 0x4369 // UT user defined types
79 // A library record contains only module records
80 // sal_uInt16 identifier BL
81 // sal_uInt32 the record's length
82 // sal_uInt16 number of modules
84 // A module-record contains all the other record types
85 // sal_uInt16 identifier BM
86 // sal_uInt32 the record's length
87 // sal_uInt16 1
88 // Data:
89 // sal_uInt32 version number
90 // sal_uInt32 character set
91 // sal_uInt32 starting address initialisation code
92 // sal_uInt32 starting address sub main
93 // sal_uInt32 reserved
94 // sal_uInt32 reserved
96 // module name, comment and source code:
97 // sal_uInt16 identifier MN, MC or SC
98 // sal_uInt32 the record's length
99 // sal_uInt16 1
100 // Data:
101 // string instance
103 // P-Code:
104 // sal_uInt16 identifier PC
105 // sal_uInt32 the record's length
106 // sal_uInt16 1
107 // Data:
108 // the P-Code as bytesack
110 // All symbols and strings are kept in a string-pool.
111 // References to these strings are in this pool in the form of an index.
113 // List of all publics:
114 // sal_uInt16 identifier PU or Pu
115 // sal_uInt32 the record's length
116 // sal_uInt16 number of publics
117 // Data for every public-entry:
118 // sal_uInt16 string index
119 // sal_uInt32 starting address in the p-code-image (sal_uInt16 for old publics)
120 // sal_uInt16 data type of the return value (from version 2)
122 // Register of the symbol tables:
123 // sal_uInt16 identifier SP
124 // sal_uInt32 the record's length
125 // sal_uInt16 number of symbol tables
126 // Data for every symbol table:
127 // sal_uInt16 stringindex of the name
128 // sal_uInt16 number of symbols
129 // sal_uInt16 scope identifier
131 // symbol table:
132 // sal_uInt16 identifier SY
133 // sal_uInt32 the record's length
134 // sal_uInt16 number of symbols
135 // Data:
136 // sal_uInt16 stringindex of the name
137 // sal_uInt16 number of symbols
138 // Data for every symbol:
139 // sal_uInt16 stringindex of the name
140 // sal_uInt16 data type
141 // sal_uInt16 length for STRING*n-symbols (0x8000: STATIC variable)
143 // Stringpool:
144 // sal_uInt16 identifier ST
145 // sal_uInt32 the record's length
146 // sal_uInt16 number of strings
147 // Data for every string:
148 // sal_uInt32 Offset in the block of all strings
149 // the block of all strings (ASCIIZ) follows then
151 // line ranges:
152 // sal_uInt16 identifier LR
153 // sal_uInt32 the record's length
154 // sal_uInt16 number of strings
155 // Data for every public:
156 // sal_uInt16 1. Zeile (Sub XXX)
157 // sal_uInt16 2. Zeile (End Sub)
159 // SBX-objects:
160 // sal_uInt16 number of objects
161 // .... object data
163 // user defined types B_USERTYPES :
164 // sal_uInt16 identifier UT
165 // sal_uInt32 the record's length
166 // sal_uInt16 number of types
167 // Data for every user defined type:
168 // string instance type name
169 // sal_Int16 number of type members
170 // Data for every type member:
171 // string name
172 // sal_Int16 type
173 // sal_uInt32 flags
174 // sal_Int16 hasObjects (0/1)
175 // If hasObjects
176 // If member type is nested type
177 // string nested type name
178 // Else (array declaration)
179 // sal_Int16 isFixedSize (0/1)
180 // sal_Int32 number of dimensions
181 // Data for every dimension:
182 // sal_Int32 lower bound
183 // sal_Int32 upper bound
185 #endif
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */