summaryrefslogtreecommitdiff
path: root/lib9p/idl/0000-README.md
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 20:14:46 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-01-14 20:14:46 -0700
commit287e11381634b879dc82b23eacb693a31c52f9ef (patch)
tree236d11893dafb8f45141fdacc7d6f47cc0aa8529 /lib9p/idl/0000-README.md
parentf7c75fe0113cdbd3e13b4e22edf76d9456c4b064 (diff)
parent6e48efec92b3357b2b762d14994d2f812a3b6ef7 (diff)
Merge branch 'lukeshu/9p-idl-defs'
Diffstat (limited to 'lib9p/idl/0000-README.md')
-rw-r--r--lib9p/idl/0000-README.md23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib9p/idl/0000-README.md b/lib9p/idl/0000-README.md
index 86862b7..036de22 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,21 @@ 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,
+ - the special value `s32_max` to refer to the constant value
+ `(1<<31)-1`, or
+ - the special value `s64_max` to refer to the constant value
+ `(1<<63)-1`
+
+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.