1 Support for the new UNOIDL types.rdb format
3 ...that replaces the old types.rdb format based on modules [[store]] and
6 Library_unoidl contains the unoidl::Manager and unoidl::Provider implementations
7 for both the new and the old types.rdb formats (unoidl::loadProvider tries both
8 implementations in turn for a given file, so the old format is still supported
9 transparently for now).
11 Executable_reg2unoidl is a helper tool to convert from the old to the new
12 types.rdb format. It is currently used at build-time. idlc still generates the
13 old format, and any new-format files (used at build-time only, or included in
14 installation sets in URE or program/types/ or as part of bundled extensions that
15 are created during the build and not merely included as pre-built .oxt files)
16 are explicitly generated via reg2unoidl. The SDK is still designed to generate
17 old-format files exclusively (especially, any non-bundled extensions will only
18 contain old-format files for now; that allows to modify the new format further
19 without having to worry about compatibility with multiple versions of that
22 == Specification of the new UNOIDL types.rdb format ==
24 The format uses byte-oriented, platform-independent, binary files. Larger
25 quantities are stored LSB first, without alignment requirements. Offsets are
26 32 bit, effectively limiting the overall file size to 4GB, but that is not
27 considered a limitation in practice (and avoids unnecessary bloat compared to
30 Annotations can be added for (non-module) entities and certain parts of such
31 entities (e.g., both for an interface type definition and for a direct method of
32 an interface type definition; the idea is that it can be added for direct parts
33 that forma a "many-to-one" relationship; there is a tradeoff between generality
34 of concept and size of representation, esp. for the C++ representation types in
35 namespace unoidl) and consist of arbitrary sequences of name/value strings.
36 Each name/value string is encoded as a single UTF-8 string containing a name (an
37 arbitrary sequence of Unicode code points not containing U+003D EQUALS SIGN),
38 optionally followed by U+003D EQUALS SIGN and a value (an abritrary sequence of
39 Unicode code points). The only annotation name currently in use is "deprecated"
42 The following definitions are used throughout:
44 * UInt16: 2-byte value, LSB first
45 * UInt32: 4-byte value, LSB first
46 * UInt64: 8-byte value, LSB first
47 * Offset: UInt32 value, counting bytes from start of file
48 * NUL-Name: zero or more non-NUL US-ASCII bytes followed by a NUL byte
49 * Len-String: UInt32 number of characters, with 0x80000000 bit 0, followed by
50 that many US-ASCII (for UNOIDL related names) resp. UTF-8 (for annotations)
52 * Idx-String: either an Offset (with 0x80000000 bit 1) of a Len-String, or a
54 * Annotations: UInt32 number N of annotations followed by N * Idx-String
55 * Entry: Offset of NUL-Name followed by Offset of payload
56 * Map: zero or more Entries
58 The file starts with an 8 byte header, followed by information about the root
59 map (reg2unoidl generates files in a single depth-first pass, so the root map
60 itself is at the end of the file):
62 * 7 byte magic header "UNOIDL\xFF"
65 * UInt32 number of entries of root Map
68 Files generated by reg2unoidl follow that by a
70 "\0** Created by LibreOffice " LIBO_VERSION_DOTTED " reg2unoidl **\0"
72 banner (cf. config_host/config_version.h.in), as a debugging aid.
74 Layout of per-entry payload in the root or a module Map:
80 **** UInt32 number N1 of entries of Map
84 *** 0x80 bit: 1 if published
85 *** 0x40 bit: 1 if annotated
86 *** 0x20 bit: flag (may only be 1 for certain kinds, see below)
91 ****** UInt32 number N1 of members
95 ******* if annotated: Annotations
97 **** 2: plain struct type (with base if flag is 1)
99 ****** if "with base": Idx-String
100 ****** UInt32 number N1 of direct members
101 ****** N1 * tuple of:
102 ******* Idx-String name
103 ******* Idx-String type
104 ******* if annotated: Annotations
106 **** 3: polymorphic struct type template
108 ****** UInt32 number N1 of type parameters
109 ****** N1 * Idx-String
110 ****** UInt32 number N2 of members
111 ****** N2 * tuple of:
112 ******* kind byte: 0x01 bit is 1 if parameterized type
113 ******* Idx-String name
114 ******* Idx-String type
115 ******* if annotated: Annotations
117 **** 4: exception type (with base if flag is 1)
119 ****** if "with base": Idx-String
120 ****** UInt32 number N1 of direct members
121 ****** N1 * tuple of:
122 ******* Idx-String name
123 ******* Idx-String type
124 ******* if annotated: Annotations
126 **** 5: interface type
128 ****** UInt32 number N1 of direct mandatory bases
129 ****** N1 * tuple of:
131 ******* if annotated: Annotations
132 ****** UInt32 number N2 of direct optional bases
133 ****** N2 * tuple of:
135 ******* if annotated: Annotations
136 ****** UInt32 number N3 of direct attributes
137 ****** N3 * tuple of:
139 ******** 0x02 bit: 1 if read-only
140 ******** 0x01 bit: 1 if bound
141 ******* Idx-String name
142 ******* Idx-String type
143 ******* UInt32 number N4 of get exceptions
144 ******* N4 * Idx-String
145 ******* UInt32 number N5 of set exceptions
146 ******* N5 * Idx-String
147 ******* if annotated: Annotations
148 ****** UInt32 number N6 of direct methods
149 ****** N6 * tuple of:
150 ******* Idx-String name
151 ******* Idx-String return type
152 ******* UInt32 number N7 of parameters
153 ******* N7 * tuple of:
154 ******** direction byte: 0 for in, 1 for out, 2 for in-out
155 ******** Idx-String name
156 ******** Idx-String type
157 ******* UInt32 number N8 of exceptions
158 ******* N8 * Idx-String
159 ******* if annotated: Annotations
165 **** 7: constant group
167 ****** UInt32 number N1 of entries of Map
170 **** 8: single-interface--based service (with default constructor if flag is 1)
173 ****** if not "with default constructor":
174 ******* UInt32 number N1 of constructors
175 ******* N1 * tuple of:
177 ******** UInt32 number N2 of parameters
178 ******** N2 * tuple of
179 ********* kind byte: 0x04 bit is 1 if rest parameter
180 ********* Idx-String name
181 ********* Idx-String type
182 ******** UInt32 number N3 of exceptions
183 ******** N3 * Idx-String
184 ******** if annotated: Annotations
186 **** 9: accumulation-based service
188 ****** UInt32 number N1 of direct mandatory base services
189 ****** N1 * tuple of:
191 ******* if annotated: Annotations
192 ****** UInt32 number N2 of direct optional base services
193 ****** N2 * tuple of:
195 ******* if annotated: Annotations
196 ****** UInt32 number N3 of direct mandatory base interfaces
197 ****** N3 * tuple of:
199 ******* if annotated: Annotations
200 ****** UInt32 number N4 of direct optional base interfaces
201 ****** N4 * tuple of:
203 ******* if annotated: Annotations
204 ****** UInt32 number N5 of direct properties
205 ****** N5 * tuple of:
207 ******** 0x0100 bit: 1 if optional
208 ******** 0x0080 bit: 1 if removable
209 ******** 0x0040 bit: 1 if maybedefault
210 ******** 0x0020 bit: 1 if maybeambiguous
211 ******** 0x0010 bit: 1 if readonly
212 ******** 0x0008 bit: 1 if transient
213 ******** 0x0004 bit: 1 if constrained
214 ******** 0x0002 bit: 1 if bound
215 ******** 0x0001 bit: 1 if maybevoid
216 ******* Idx-String name
217 ******* Idx-String type
218 ******* if annotated: Annotations
220 **** 10: interface-based singleton
224 **** 11: service-based singleton
228 *** if annotated, followed by: Annotations
230 Layout of per-entry payload in a constant group Map:
233 ** 0x80 bit: 1 if annotated
237 **** followed by value byte, 0 represents false, 1 represents true
240 **** followed by value byte, representing values with two's complement
243 **** followed by UInt16 value, representing values with two's complement
245 *** 3: UNSIGNED SHORT
246 **** followed by UInt16 value
249 **** followed by UInt32 value, representing values with two's complement
252 **** followed by UInt32 value
255 **** followed by UInt64 value, representing values with two's complement
257 *** 7: UNSIGNED HYPER
258 **** followed by UInt64 value
261 **** followed by 4-byte value, representing values in ISO 60599 binary32 format,
265 **** followed by 8-byte value, representing values in ISO 60599 binary64 format,
268 * if annotated, followed by: Annotations