Skip to content

Commit e3ade3e

Browse files
livingsilver94NomadicCore
authored andcommitted
developers: stone: Emphasize stones have versions
1 parent b6dfa59 commit e3ade3e

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

src/content/docs/Developers/Stone/index.mdx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
---
22
title: Stone Format
3-
lastUpdated: 2026-04-11T00:00:00Z
3+
lastUpdated: 2026-04-19T00:00:00Z
44
description: An overwiew of the Stone format
55
---
66
import DirectoryList from '@components/DirectoryList.astro';
77

88
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.
1111

1212
Anything encoded in the Stone format is called a *stone*.
1313
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
1515
the Prelude.
1616

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+
1724
```mermaid
1825
%%{
1926
init: {
@@ -24,7 +31,7 @@ the Prelude.
2431
}%%
2532
packet
2633
+32: "Prelude — 32 bits"
27-
+16: "Payload 1 header —32 bits"
34+
+16: "Payload 1 header — 32 bits"
2835
+16: "Payload 1 records — Variable length"
2936
+16: "Payload 2 header — 32 bits"
3037
+16: "Payload 2 records — Variable length"
@@ -39,6 +46,9 @@ The fundamental types of the Stone format are integer numbers and strings.
3946
| 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|
4047
| String | UTF-8 | Various | A string of text, without the NULL termination. |str|
4148

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+
4252
The documentation will delve into the details of each section in the next pages.
4353

4454
<DirectoryList/>

0 commit comments

Comments
 (0)