Expand description
OWP 1.0 text-frame codec. Grammar follows OMSC-SPC-013; no UCI types.
A frame is a keyword plus space-or-tab separated fields. JSON payloads
(INIT, INFO, PUB) keep their spaces: the first token is the
field, the rest of the line is the payload. This module does not
compile a schema or convert XML.
StructsΒ§
- UUID triple sent on
INFO. - JSON body of a server
INFOframe. - JSON body of a client
INITframe.
EnumsΒ§
- A parsed client frame.
- Protocol error name carried on
-ERR. - Why a frame could not be parsed.
- A parsed server frame, or one about to be written.
FunctionsΒ§
- is_
delim πSpace or tab. Newlines are not delimiters; a frame is one line. - Whether
sis an OWP identifier:^[A-Za-z0-9_\-.]+$. - Parses one client text frame (
INIT,PUB,SUB,UNSUB). - parse_
init π - parse_
pub π - Parses one server text frame (
+OK,-ERR,INFO,MSG). - parse_
sub π - parse_
unsub π - split_
first_ πtoken First non-delimiter run and the remainder, with leading delimiters stripped from the remainder.Noneifsis only delimiters. - tokenize πUp to
maxtokens. Leftover text aftermaxis dropped, so the caller must treatlen == maxas βmaybe moreβ when extra fields are illegal. - Returns the single root key of an OMS JSON object.