RISC OS Build EnvironmentROBE

Appendix48Appendix N: Allocate request file formats

Overview

This appendix documents the request formats used when preparing allocations for the RISC OS Open allocations service. The build environment's riscos-allocate command uses a UTF-8 YAML description as its editable form and can recreate the historical binary Allocate request file used by the !Allocate desktop application.

The YAML description is intended for inspection, editing, and source control. The binary request file is intended for interchange with the historical application and for submission workflows that still expect the saved Allocate request format.

YAML description format

Top-level structure

The YAML document is a mapping with the following top-level keys:

KeyMeaning
SchemaVersionVersion of the YAML description schema. The current tool writes 1.
FormatVersionAllocate request-file version. The current Allocate file format uses 1.00, corresponding to binary value 100.
DeveloperMapping containing the requestor details.
RegistrationsSequence of registration objects in the same order as the binary request file.

Empty optional scalar fields are written as YAML null.

Developer mapping

The Developer mapping contains these keys:

KeyContents
NameRequestor name.
CompanyCompany or organisation name.
DeveloperNumberDeveloper number, if any.
Address1First address line.
Address2Second address line.
Address3Third address line.
Address4Fourth address line.
PhoneTelephone number.
FaxFax number.
EmailEmail address.

Registration sequence

Each entry in Registrations is a mapping containing exactly one registration type name and its field mapping. The type names written by the tool are:

TypeFields
SWIChunkPrefix, Description.
MessageBlockDescription.
ReservationType, Text.
FiletypeApplicationName, Name, DoubleClicking, and attachment fields.
ErrorBlockDescription.
PoduleAllocateManufacturer, ManufacturerId, PoduleName, Description.
DrawTagBlockDescription.
DrawObjectBlockDescription.
FilingSystemName, Selector.
ServiceBlockDescription.
DeviceName, Description.

For compatibility, the creator also accepts space-separated and title-cased variants of these names, such as SWIChunk and SWI chunk.

Filetype attachments

Filetype registrations carry three attachments: a sprite file, a product description, and a format description.

In inline YAML output:

  • Sprite contains the sprite data encoded as base64 text.
  • ProductDescription contains the product description as decoded text.
  • FormatDescription contains the format description as decoded text.

When detached exports are used, those inline fields are replaced by filename references:

KeyReferenced file
SpriteFileSprite attachment, normally written with host suffix ,ff9.
ProductDescriptionFileProduct description attachment, written as a text file.
FormatDescriptionFileFormat description attachment, written as a text file.

If both an inline field and the corresponding detached-file field are present when creating a request, the detached file takes precedence and a warning is emitted.

Text encoding

Developer-detail fields and fixed text fields in the binary Allocate format are stored as fixed-width Latin-1 byte arrays. Text attachments within filetype registrations are also treated as Latin-1. The YAML description is written as UTF-8, so binary Latin-1 text is decoded to Unicode when extracting and is encoded back to Latin-1 when creating a request file.

If a YAML value contains characters outside Latin-1, the creator warns and replaces each unrepresentable character with ? during creation.

Binary request file format

Conventions

The historical Allocate application stores an allocation request as a binary data file with RISC OS filetype &FB0. The file contains the requestor's developer details followed by a sequence of allocation request objects.

All integer fields are written as native C int values by the historical implementation. In the supplied sources these are 32-bit little-endian values. Text fields are fixed-length byte arrays written exactly as stored in memory.

Fixed-length text fields are not length-prefixed. The application initialises new structures to zero, then copies user text into them, so unused bytes are normally NUL padded. Readers should treat the last byte of each field as part of the stored field width rather than as guaranteed spare space.

The request file magic is the eight ASCII bytes ALLOCATE with no terminator.

Overall layout

OffsetSizeNameContents
08magicASCII ALLOCATE, without a terminator.
84versionFile format version multiplied by 100. The supplied implementation writes 100.
124object_countNumber of request objects following the developer details block.
16452developer_detailsDeveloper details block; see the next subsection.
468objectsSequence of Object records entries.

Developer details block

The developer details block is stored inline in every binary request file. The same structure is also used for the standalone details file used by historical Allocate versions.

OffsetSizeFieldContents
040nameRequestor name.
4050companyCompany or organisation name.
9012developer_numberDeveloper number.
10250address1First address line.
15250address2Second address line.
20250address3Third address line.
25250address4Fourth address line.
30250phoneTelephone number.
35250faxFax number.
40250emailEmail address.

Object records

Each request object begins with a two-word header:

OffsetSizeFieldContents
04idObject type identifier.
44sizeSize in bytes of the object payload that follows, not including this header.
8payloadObject-specific data for the type named by id.

The object identifiers are:

IDObject type
0SWI chunk
1Message block
2Reservation
3Filetype request
4Error block
5Podule allocation
6Draw tag block
7Draw object block
8Filing system
9Service call block
10Device number

Object payloads

SWI chunk object
OffsetSizeFieldContents
020prefixRequested SWI prefix.
20100descriptionDescription of the module or use.
Message block object
OffsetSizeFieldContents
0100descriptionDescription of the protocol or message usage.
Reservation object
OffsetSizeFieldContents
040textName to reserve.
4020typeReservation class, such as AppName or ModName.
Filetype object

The filetype request is the only variable-length object type. Its payload begins with a fixed part followed by three embedded file blocks. Historical files were commonly written from a 32-bit C structure, so many real request files include 3 bytes of padding between the 9-byte filetype name and the Boolean double-click flag. The converter accepts both the padded and the packed layout.

OffsetSizeFieldContents
012appnameApplication name associated with the filetype.
129fnameRequested filetype name.
21-23Reserved, must be zero
244double_clickingBoolean flag indicating whether double-click loading is supported.
284sprite_sizeSize in bytes of the sprite file data.
32sprite_dataSprite file contents.
32+sprite_size4prod_desc_sizeSize in bytes of the product description file.
36+sprite_sizeprod_desc_dataProduct description file contents.
36+sprite_size+prod_desc_size4format_sizeSize in bytes of the file format description file.
40+sprite_size+prod_desc_sizeformat_dataFormat description contents.
Error block object
OffsetSizeFieldContents
0100descriptionDescription of the module or purpose requiring the error numbers.
Podule object
OffsetSizeFieldContents
04allocate_manfBoolean flag. Non-zero means a manufacturer number is also required.
44manfExisting manufacturer number when allocate_manf is zero; otherwise the field is not significant.
820podule_namePodule name.
28100descriptionDescription of the podule.
Draw tag object
OffsetSizeFieldContents
0100descriptionDescription of the use for the tagged object range.
Draw object object
OffsetSizeFieldContents
0100descriptionDescription of the use for the Draw object range.
Filing system object
OffsetSizeFieldContents
020nameFiling system name.
2020selectSelection name used to choose the filing system.
Service block object
OffsetSizeFieldContents
0100descriptionDescription of the module or interface using the service calls.
Device object
OffsetSizeFieldContents
020nameDevice name.
20100descriptionDescription of the device or its use.

Historical Allocate versions also store the requestor details in a standalone details file, generate a plain-text email export containing a uuencoded copy of the binary request, can save reservation objects as a CSV file, and can save a plain-text reply form for the allocations service.

Those additional formats are derived directly from the in-memory request and do not replace the binary request file or the YAML description as the canonical editable forms in this build environment.

Examples

Minimal reservation request

The following YAML reserves a module name:

SchemaVersion: 1
FormatVersion: 1.00
Developer:
  Name: Example Developer
  Company: null
  DeveloperNumber: null
  Address1: null
  Address2: null
  Address3: null
  Address4: null
  Phone: null
  Fax: null
  Email: example@example.invalid
Registrations:
  - Reservation:
      Type: ModName
      Text: ExampleModule

Create the binary request file with:

riscos-allocate --create request.yaml -o request,fb0