You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Stone format is a binary format designed to be type-safe and version-aware.
9
-
It is used to package and distribute software in AerynOS, in fact both the very packages and the index
10
-
file of repositories use the Stone format.
9
+
It is used to package and distribute software in AerynOS, in fact both the packages themselves
10
+
and the index file of repositories use the Stone format.
11
11
12
12
Anything encoded in the Stone format is called a *stone*.
13
13
Each *stone* is composed of a Prelude (the global header) and zero or more payloads, each with its own sub-header.
14
-
No limit is set for the length of a *stone*, but it will always be at least 32 byte long, that is the size of
14
+
No limit is set for the length of a *stone*, but it will always be at least 32 bytes long, that is the size of
15
15
the Prelude.
16
16
17
+
To completely encode or decode a given *stone*, The Stone version must be taken into account,
18
+
as different versions may support different contents.
19
+
The version is stored in the Prelude, as explained in the pages to come.
20
+
For now, it is sufficient to remember that each *stone* targets exactly one version.
21
+
22
+
Described below is the general (that is, version-agnostic) layout of a *stone*.
23
+
17
24
```mermaid
18
25
%%{
19
26
init: {
@@ -24,7 +31,7 @@ the Prelude.
24
31
}%%
25
32
packet
26
33
+32: "Prelude — 32 bits"
27
-
+16: "Payload 1 header —32 bits"
34
+
+16: "Payload 1 header —32 bits"
28
35
+16: "Payload 1 records — Variable length"
29
36
+16: "Payload 2 header — 32 bits"
30
37
+16: "Payload 2 records — Variable length"
@@ -39,6 +46,9 @@ The fundamental types of the Stone format are integer numbers and strings.
39
46
| Unsigned integer | Big-endian | Various | Integer number without a sign. The range of values goes from 0 to 2^(n)-1, where `n` is the number of bytes. |int|
40
47
| String | UTF-8 | Various | A string of text, without the NULL termination. |str|
41
48
49
+
Types with a variable length are always combined with a field that reveals the actual length.
50
+
The position of such field depends on the version of the Stone format in use.
51
+
42
52
The documentation will delve into the details of each section in the next pages.
0 commit comments