3 eplumb, plumbfree, plumbopen, plumbunmount, 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 plumbunmount(void)
20 int plumbsend(int fd, Plumbmsg *m)
23 int plumbsendtext(int fd, char *src, char *dst, char *wdir, char *data)
26 void plumbfree(Plumbmsg *m)
29 Plumbmsg* plumbrecv(int fd)
32 char* plumbpack(Plumbmsg *m, int *np)
35 Plumbmsg* plumbunpack(char *buf, int n)
38 Plumbmsg* plumbunpackpartial(char *buf, int n, int *morep)
41 char* plumbpackattr(Plumbattr *a)
44 Plumbattr* plumbunpackattr(char *a)
47 char* plumblookup(Plumbattr *a, char *name)
50 Plumbattr* plumbaddattr(Plumbattr *a, Plumbattr *new)
53 Plumbattr* plumbdelattr(Plumbattra *a, char *name)
56 int eplumb(int key, char *port)
62 CFid *plumbopenfid(char *port, int omode)
65 Plumbmsg* plumbrecvfid(CFid *fid)
68 int plumbsendtofid(CFid *fid, Plumbmsg *m)
70 These routines manipulate
72 messages, transmitting them, receiving them, and
73 converting them between text and these data structures:
76 .ta 6n +\w'\fLPlumbattr 'u +\w'ndata; 'u
107 begins with a slash, it is taken as a literal file name;
110 searches for the location of the
112 service and opens the port there.
114 For programs using the
118 registers, using the given
120 receipt of messages from the named
123 The library mounts the
125 service on demand (using the
127 library and reuses the mount instance for future
131 causes the library to discard its cached mount.
132 This can be useful if the plumber service itself has been
133 restarted and a client wishes to reconnect.
136 formats and writes message
138 to the file descriptor
140 which will usually be the result of
144 is a simplified version for text-only messages; it assumes
154 .BI strlen( data )\f1.
157 frees all the data associated with the message
159 all the components of which must therefore have been allocated with
163 returns the next message available on the file descriptor
170 as a character string in the format of
174 to the length in bytes of the string.
176 does the inverse, translating the
183 .I Plumbunpackpartial
184 enables unpacking of messages that arrive in pieces.
186 .I plumbunpackpartial
187 for a given message must be sufficient to unpack the header;
188 subsequent calls permit unpacking messages with long data sections.
191 points to the beginning of the complete message received so far, and
193 reports the total number of bytes received for that message.
194 If the message is complete, the return value will be as in
198 is not null, the return value will be
202 will be set to the number of bytes remaining to be read for this message to be complete
203 (recall that the byte count is in the header).
204 Those bytes should be read by the caller, placed at location
206 and the message unpacked again.
207 If an error is encountered, the return value will be
218 structures into a null-terminated string.
219 If an attribute value contains white space, quote characters, or equal signs,
220 the value will be quoted appropriately.
221 A newline character will terminate processing.
223 converts the null-terminated string
234 for an attribute with the given
236 and returns the associated value.
237 The returned string is the original value, not a copy.
238 If the attribute has no value, the returned value will be the empty string;
239 if the attribute does not occur in the list at all, the value will be nil.
245 (which may be a list) to the attribute list
247 and returns the new list.
251 for the first attribute with name
253 and deletes it from the list, returning the resulting list.
255 is a no-op if no such attribute exists.
257 The file descriptor returned by
263 which masks information about read and write errors.
264 This is acceptable for use in
268 which depends on seeing details of write errors.
273 provide an explicit interface to
275 that preserves the exact error details.
284 When appropriate, including when a
286 fails, these routine set
289 To avoid rewriting clients that use
294 returns a useless file descriptor
298 looks for this particular file descriptor
299 and uses a static copy of the