diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-14 00:38:14 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-01-14 19:39:42 -0700 |
commit | 2ae048377f738cb1c96f8132eae106271ca05ab8 (patch) | |
tree | 8c5d3e4e8902f2f7b2814acdec7d47b7ab5cf800 | |
parent | f7c75fe0113cdbd3e13b4e22edf76d9456c4b064 (diff) |
lib9p: Fixup the idl README
-rw-r--r-- | lib9p/idl/0000-README.md | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib9p/idl/0000-README.md b/lib9p/idl/0000-README.md index 86862b7..a541006 100644 --- a/lib9p/idl/0000-README.md +++ b/lib9p/idl/0000-README.md @@ -1,7 +1,7 @@ <!-- lib9p/idl/0000-README.md - Overview of 9P protocol definitions - Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> + Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> SPDX-License-Identifier: AGPL-3.0-or-later --> @@ -35,7 +35,7 @@ bitfields, structures, - struct STRUCTNAME = "FILENAME[FIELDTYPE]..." + struct STRUCTNAME = "FIELDNAME[FIELDTYPE]..." and messages (which are a special-case of structures). @@ -44,8 +44,17 @@ and messages (which are a special-case of structures). Struct fields that have numeric types (either primitives or `num` types) can add to their type `,val=` and/or `,max=` to specify what the exact value must be and/or what the maximum (inclusive) value is. +A field that is repeated a variable number of times be wrapped in +parenthesis and prefixed with the fieldname containing that count: +`OTHERFIELDNAME*(FIELDNAME[FIELDTYPE])`. `,val=` and `,max` take a string of `+`/`-` tokens and values; a value -can either be a decimal numeric constant (eg: `107`), the `&fieldname` -to refer to the offset of a field name in that struct, or the special -value `end` to refer to the offset of the end of the struct. +can be + - a decimal numeric constant (eg: `107`), + - `&fieldname` to refer to the offset of a field name in that struct, + - the special value `end` to refer to the offset of the end of the + struct, + +A parser for this syntax is given in `__init__.py`. However, +`__init__.py` places the somewhat arbitrary undocumented restrictions +on fields referenced as the count for a repeated field. |