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.
51 It is the caller's responsibility to
52 free this structure when it is no longer needed.
55 walks through the array
62 that matches the parsed command.
63 (If the parsed command is empty,
65 returns nil immediately.)
68 matches the command if
80 is not zero, then the parsed command
83 fields (including the command string itself).
84 If the command has the wrong number of arguments,
87 Otherwise, it returns a pointer to the
92 does not find a matching command at all,
96 returns nil, it sets the system error string.
101 with an error of the form
102 `\fIfmt\fB:\fI cmd\fR,'
105 is the formatted string and
107 is a reconstruction of the parsed command.
112 This interface is not used in any distributed 9P servers.
113 It was lifted from the Plan 9 kernel.
114 Almost any kernel driver
115 .RB ( /sys/src/9/*/dev*.c )
118 .B /sys/src/lib9p/parse.c