3 Cmdbuf, parsecmd, respondcmderror, lookupcmd \- control message parsing
16 .ta \w'\fL1234'u +\w'\fL12345678'u
31 Cmdbuf *parsecmd(char *p, int n)
32 Cmdtab *lookupcmd(Cmdbuf *cb, Cmdtab *tab, int ntab)
33 void respondcmderror(Req *r, Cmdbuf *cb, char *fmt, ...)
36 These data structures and functions provide parsing of textual control messages.
43 (which need not be NUL-terminated) as a UTF string and splits it
50 structure holding pointers to each field in the message.
53 walks through the array
60 that matches the parsed command.
61 (If the parsed command is empty,
63 returns nil immediately.)
66 matches the command if
78 is not zero, then the parsed command
81 fields (including the command string itself).
82 If the command has the wrong number of arguments,
85 Otherwise, it returns a pointer to the
90 does not find a matching command at all,
94 returns nil, it sets the system error string.
99 with an error of the form
100 `\fIfmt\fB:\fI cmd\fR,'
103 is the formatted string and
105 is a reconstruction of the parsed command.
110 This interface is not used in any distributed 9P servers.
111 It was lifted from the Plan 9 kernel.
112 Almost any Plan 9 kernel driver
113 .RB ( /sys/src/9/*/dev*.c
117 .B \*9/src/lib9p/parse.c