3 eplumb, plumbfree, plumbopen, plumbopenfid, plumbsend, plumbsendtofid, plumbsendtext, plumblookup, plumbpack, plumbpackattr, plumbaddattr, plumbdelattr, plumbrecv, plumbrecvfid, plumbunpack, plumbunpackpartial, plumbunpackattr, Plumbmsg \- plumb messages
11 .ta \w'\fLPlumbattr* 'u
14 int plumbopen(char *port, int omode)
17 int plumbsend(int fd, Plumbmsg *m)
20 int plumbsendtext(int fd, char *src, char *dst, char *wdir, char *data)
23 void plumbfree(Plumbmsg *m)
26 Plumbmsg* plumbrecv(int fd)
29 char* plumbpack(Plumbmsg *m, int *np)
32 Plumbmsg* plumbunpack(char *buf, int n)
35 Plumbmsg* plumbunpackpartial(char *buf, int n, int *morep)
38 char* plumbpackattr(Plumbattr *a)
41 Plumbattr* plumbunpackattr(char *a)
44 char* plumblookup(Plumbattr *a, char *name)
47 Plumbattr* plumbaddattr(Plumbattr *a, Plumbattr *new)
50 Plumbattr* plumbdelattr(Plumbattra *a, char *name)
53 int eplumb(int key, char *port)
59 CFid *plumbopenfid(char *port, int omode)
62 Plumbmsg* plumbrecvfid(CFid *fid)
65 int plumbsendtofid(CFid *fid, Plumbmsg *m)
67 These routines manipulate
69 messages, transmitting them, receiving them, and
70 converting them between text and these data structures:
73 .ta 6n +\w'\fLPlumbattr 'u +\w'ndata; 'u
104 begins with a slash, it is taken as a literal file name;
107 searches for the location of the
109 service and opens the port there.
111 For programs using the
115 registers, using the given
117 receipt of messages from the named
121 formats and writes message
123 to the file descriptor
125 which will usually be the result of
129 is a simplified version for text-only messages; it assumes
139 .BI strlen( data )\f1.
142 frees all the data associated with the message
144 all the components of which must therefore have been allocated with
148 returns the next message available on the file descriptor
155 as a character string in the format of
159 to the length in bytes of the string.
161 does the inverse, translating the
168 .I Plumbunpackpartial
169 enables unpacking of messages that arrive in pieces.
171 .I plumbunpackpartial
172 for a given message must be sufficient to unpack the header;
173 subsequent calls permit unpacking messages with long data sections.
176 points to the beginning of the complete message received so far, and
178 reports the total number of bytes received for that message.
179 If the message is complete, the return value will be as in
183 is not null, the return value will be
187 will be set to the number of bytes remaining to be read for this message to be complete
188 (recall that the byte count is in the header).
189 Those bytes should be read by the caller, placed at location
191 and the message unpacked again.
192 If an error is encountered, the return value will be
203 structures into a null-terminated string.
204 If an attribute value contains white space, quote characters, or equal signs,
205 the value will be quoted appropriately.
206 A newline character will terminate processing.
208 converts the null-terminated string
219 for an attribute with the given
221 and returns the associated value.
222 The returned string is the original value, not a copy.
223 If the attribute has no value, the returned value will be the empty string;
224 if the attribute does not occur in the list at all, the value will be nil.
230 (which may be a list) to the attribute list
232 and returns the new list.
236 for the first attribute with name
238 and deletes it from the list, returning the resulting list.
240 is a no-op if no such attribute exists.
242 The file descriptor returned by
248 which masks information about read and write errors.
249 This is acceptable for use in
253 which depends on seeing details of write errors.
258 provide an explicit interface to
260 that preserves the exact error details.
269 When appropriate, including when a
271 fails, these routine set
274 To avoid rewriting clients that use
279 returns a useless file descriptor
283 looks for this particular file descriptor
284 and uses a static copy of the